Commit 50e49003 authored by Naman Dixit's avatar Naman Dixit

Added docker instrumentor

parent 3318bde5
......@@ -7,12 +7,22 @@ internal_function
noreturn
void* dockerProcessLoop (void *arg)
{
unused_variable(arg);
pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, NULL);
while (true) {
// TODO(naman): Get data
Char *data_cmd = NULL;
sbufPrint(data_cmd, "docker stats %s", (Char*)arg);
FILE* data_file = popen(data_cmd, "r");
fseek(data_file, 0, SEEK_END);
long size = ftell(data_file);
fseek(data_file, 0, SEEK_SET);
Char *data = calloc((Size)size + 1, sizeof(*data));
fread(data, 1, (Size)size + 1, data_file);
fclose(data_file);
Char *json = NULL;
Char *output = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment