Context switches in process module have negative values
bachandi opened this issue · comments
The context switches plot shows the negative ics
values. I am not really sure why. In the legend the tcs=vcs+ics
are written. Any reason for plotting n_ics=-1*ics
and vcs
in the same color instead of just tcs
?
If there is no reason it could be switched to just show tcs
values:
index c8fdadd..febe227 100644
--- a/lib/process.pm
+++ b/lib/process.pm
@@ -1277,14 +1277,12 @@ sub process_cgi {
if($p) {
$str = trim((split(',', $process->{desc}->{$p} || ""))[0]) || $p;
$str =~ s/:/\\:/g; # escape colons
- push(@tmpz, "LINE2:vcs" . $n . $LC[$n] . ":$str");
- push(@tmpz, "LINE2:n_ics" . $n . $LC[$n]);
+ push(@tmpz, "LINE2:tcs" . $n . $LC[$n] . ":$str");
$str = sprintf("%-20s", substr($str, 0, 20));
- push(@tmp, "LINE2:vcs" . $n . $LC[$n] . ":$str");
- push(@tmp, "GPRINT:tcs" . $n . ":LAST:Cur\\: %4.0lf");
- push(@tmp, "GPRINT:tcs" . $n . ":MIN: Min\\: %4.0lf");
- push(@tmp, "GPRINT:tcs" . $n . ":MAX: Max\\: %4.0lf\\n");
- push(@tmp, "LINE2:n_ics" . $n . $LC[$n]);
+ push(@tmp, "LINE2:tcs" . $n . $LC[$n] . ":$str");
+ push(@tmp, "GPRINT:tcs" . $n . ":LAST:Cur\\: %4.2lf");
+ push(@tmp, "GPRINT:tcs" . $n . ":MIN: Min\\: %4.2lf");
+ push(@tmp, "GPRINT:tcs" . $n . ":MAX: Max\\: %4.2lf\\n");
}
}
if($title) {
If I recall correctly, this is intended to differentiate between voluntary and involuntary context switches in the same graph and using the same color for each metric.
So, all involuntary context switches are negative and the voluntary ones are in positive values. This should show a more readable graph than using stacked values or using a unique value for each metric.
I hope this answers your question.
Looks good to me.
This will increase graph readability.