diff options
author | Charles Duffy <chaduffy@cisco.com> | 2015-06-02 17:38:49 -0500 |
---|---|---|
committer | Charles Duffy <chaduffy@cisco.com> | 2015-06-10 18:06:28 -0500 |
commit | 1d84ae050cb1eb6bfbcd17a10de4e5804fdd4722 (patch) | |
tree | 28611eb325318606f3e49cdb06be5990b27966c5 /src/cgtop/cgtop.c | |
parent | dcc7aacd67505b812214058dc9a8d321d8d98c7c (diff) |
cgtop: IO readings are valid if any data is available, even if unchanged since last tick
Emit "0" rather than "-" if no change in IO values are seen for a process since
last tick, so long as accounting has registered content at all.
Diffstat (limited to 'src/cgtop/cgtop.c')
-rw-r--r-- | src/cgtop/cgtop.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index 3a2842dac6..d630e35882 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -281,11 +281,10 @@ static int process(const char *controller, const char *path, Hashmap *a, Hashmap yr = rd - g->io_input; yw = wr - g->io_output; - if (yr > 0 || yw > 0) { + if (g->io_input > 0 || g->io_output > 0) { g->io_input_bps = (yr * 1000000000ULL) / x; g->io_output_bps = (yw * 1000000000ULL) / x; g->io_valid = true; - } } |