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.
This commit is contained in:
Charles Duffy 2015-06-02 17:38:49 -05:00
parent dcc7aacd67
commit 1d84ae050c

View file

@ -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;
}
}