From: Michael Tremer Date: Thu, 24 Sep 2020 11:12:46 +0000 (+0000) Subject: processors: Add line with total usage X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e0ef4a71c7523061a8559ba6702abed814fdd77;p=telemetry.git processors: Add line with total usage Signed-off-by: Michael Tremer --- diff --git a/src/collecty/plugins/processor.py b/src/collecty/plugins/processor.py index 6a4aec2..5eeb93c 100644 --- a/src/collecty/plugins/processor.py +++ b/src/collecty/plugins/processor.py @@ -33,7 +33,11 @@ class GraphTemplateProcessor(base.GraphTemplate): _ = self.locale.translate return [ - "CDEF:total=user,nice,+,sys,+,wait,+,irq,+,sirq,+,steal,+,guest,+,guest_nice,+,idle,+", + # Add all used CPU cycles + "CDEF:usage=user,nice,+,sys,+,wait,+,irq,+,sirq,+,steal,+,guest,+,guest_nice,+", + + # Add idle to get the total number of cycles + "CDEF:total=usage,idle,+", "CDEF:user_p=100,user,*,total,/", "AREA:user_p%s:%-15s" % (CPU_USER, _("User")), @@ -89,6 +93,12 @@ class GraphTemplateProcessor(base.GraphTemplate): "GPRINT:guest_nice_p_min:%12s\:" % _("Minimum") + " %6.2lf%%", "GPRINT:guest_nice_p_avg:%12s\:" % _("Average") + " %6.2lf%%\\n", + "CDEF:usage_p=100,usage,*,total,/", + "COMMENT: %-15s" % _("Usage"), + "GPRINT:usage_p_max:%12s\:" % _("Maximum") + " %6.2lf%%", + "GPRINT:usage_p_min:%12s\:" % _("Minimum") + " %6.2lf%%", + "GPRINT:usage_p_avg:%12s\:" % _("Average") + " %6.2lf%%\\n", + "CDEF:idle_p=100,idle,*,total,/", "STACK:idle_p%s:%-15s" % (CPU_IDLE, _("Idle")), "GPRINT:idle_p_max:%12s\:" % _("Maximum") + " %6.2lf%%",