Skip to content

Commit

Permalink
Merge a658d6c into 7a4a4a6
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberDem0n committed May 14, 2020
2 parents 7a4a4a6 + a658d6c commit a66ee1a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bg_mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ static void prepare_statistics_output(struct evbuffer *evb)
cgroup_cpu cc = c.cgroup;
evbuffer_add_printf(evb, "}}, \"cgroup\": {");
if (cm.available) {
evbuffer_add_printf(evb, "\"memory\": {\"limit\": %lu, \"usage\": %lu", cm.limit, cm.usage);
evbuffer_add_printf(evb, ", \"rss\": %lu, \"cache\": %lu", cm.rss, cm.cache);
evbuffer_add_printf(evb, ", \"dirty\": %lu, \"oom_kill\": %lu", cm.dirty, cm.oom_kill);
evbuffer_add_printf(evb, "\"memory\": {\"limit\": %lu, \"usage\": %lu, ", cm.limit, cm.usage);
evbuffer_add_printf(evb, "\"rss\": %lu, \"cache\": %lu, \"dirty\": %lu", cm.rss, cm.cache, cm.dirty);
evbuffer_add_printf(evb, ", \"oom_kill\": %lu, \"failcnt\": %lu", cm.oom_kill, cm.failcnt);
if (cc.available)
evbuffer_add_printf(evb, "}, ");
}
Expand Down
1 change: 1 addition & 0 deletions system_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ static cgroup_memory read_cgroup_memory_stats(void)

cm.available = true;
cm.usage = cgroup_read_ulong("usage_in_bytes") / 1024;
cm.failcnt = cgroup_read_ulong("failcnt");

strcpy(memory_cgroup + memory_cgroup_len, "stat");
if ((csfd = fopen(memory_cgroup, "r")) == NULL)
Expand Down
1 change: 1 addition & 0 deletions system_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ typedef struct {
unsigned long cache;
unsigned long dirty;
unsigned long oom_kill;
unsigned long failcnt;
} cgroup_memory;

typedef struct {
Expand Down

0 comments on commit a66ee1a

Please sign in to comment.