monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[monit-dev] [monit] r238 committed - * Fixed display of cpu user/system/


From: monit
Subject: [monit-dev] [monit] r238 committed - * Fixed display of cpu user/system/wait usage which temporarily displa...
Date: Wed, 15 Sep 2010 11:10:35 +0000

Revision: 238
Author: martin2812
Date: Wed Sep 15 04:10:05 2010
Log: * Fixed display of cpu user/system/wait usage which temporarily displayed -1.0% between two monitoring cycles while cpu monitoring was initializing. Thanks to
  Marcus Muelbuesch for report.


http://code.google.com/p/monit/source/detail?r=238

Modified:
 /trunk/CHANGES.txt
 /trunk/http/cervlet.c
 /trunk/xml.c

=======================================
--- /trunk/CHANGES.txt  Fri Sep 10 07:09:15 2010
+++ /trunk/CHANGES.txt  Wed Sep 15 04:10:05 2010
@@ -112,6 +112,10 @@
The extra NL character may break the mail headers. Thanks to Hanno Boeck for
   report and patch.

+* Fixed display of cpu user/system/wait usage which temporarily displayed -1.0% + between two monitoring cycles while cpu monitoring was initializing. Thanks to
+  Marcus Muelbuesch for report.
+


 Version 5.1.1
=======================================
--- /trunk/http/cervlet.c       Mon Sep  6 05:48:55 2010
+++ /trunk/http/cervlet.c       Wed Sep 15 04:10:05 2010
@@ -920,9 +920,10 @@
       "<td align=\"right\" width=\"20%%\">%.1f%% [%ld&nbsp;kB]</td>"
       "<td align=\"right\" width=\"20%%\">%.1f%% [%ld&nbsp;kB]</td>",
       systeminfo.loadavg[0], systeminfo.loadavg[1], systeminfo.loadavg[2],
- systeminfo.total_cpu_user_percent/10., systeminfo.total_cpu_syst_percent/10., + systeminfo.total_cpu_user_percent > 0 ? systeminfo.total_cpu_user_percent/10. : 0, + systeminfo.total_cpu_syst_percent > 0 ? systeminfo.total_cpu_syst_percent/10. : 0,
     #ifdef HAVE_CPU_WAIT
-      systeminfo.total_cpu_wait_percent/10.,
+ systeminfo.total_cpu_wait_percent > 0 ? systeminfo.total_cpu_wait_percent/10. : 0,
     #endif
       systeminfo.total_mem_percent/10., systeminfo.total_mem_kbyte,
       systeminfo.total_swap_percent/10., systeminfo.total_swap_kbyte);
@@ -2258,10 +2259,10 @@
         #endif
           "%s",
           (s->error & Event_Resource)?" color='#ff0000'":"",
-          systeminfo.total_cpu_user_percent/10.,
-          systeminfo.total_cpu_syst_percent/10.,
+ systeminfo.total_cpu_user_percent > 0 ? systeminfo.total_cpu_user_percent/10. : 0, + systeminfo.total_cpu_syst_percent > 0 ? systeminfo.total_cpu_syst_percent/10. : 0,
         #ifdef HAVE_CPU_WAIT
-          systeminfo.total_cpu_wait_percent/10.,
+ systeminfo.total_cpu_wait_percent > 0 ? systeminfo.total_cpu_wait_percent/10. : 0,
         #endif
           "</font></td></tr>");
         out_print(res,
@@ -2493,10 +2494,10 @@
           systeminfo.loadavg[1],
           systeminfo.loadavg[2],
           "cpu",
-          systeminfo.total_cpu_user_percent/10.,
-          systeminfo.total_cpu_syst_percent/10.,
+ systeminfo.total_cpu_user_percent > 0 ? systeminfo.total_cpu_user_percent/10. : 0, + systeminfo.total_cpu_syst_percent > 0 ? systeminfo.total_cpu_syst_percent/10. : 0,
         #ifdef HAVE_CPU_WAIT
-          systeminfo.total_cpu_wait_percent/10.,
+ systeminfo.total_cpu_wait_percent > 0 ? systeminfo.total_cpu_wait_percent/10. : 0,
         #endif
           "memory usage",
           systeminfo.total_mem_kbyte,
=======================================
--- /trunk/xml.c        Mon Sep  6 05:48:55 2010
+++ /trunk/xml.c        Wed Sep 15 04:10:05 2010
@@ -413,10 +413,10 @@
                                        systeminfo.loadavg[0],
                                        systeminfo.loadavg[1],
                                        systeminfo.loadavg[2],
-                                       systeminfo.total_cpu_user_percent/10.,
-                                       systeminfo.total_cpu_syst_percent/10.,
+ systeminfo.total_cpu_user_percent > 0 ? systeminfo.total_cpu_user_percent/10. : 0, + systeminfo.total_cpu_syst_percent > 0 ? systeminfo.total_cpu_syst_percent/10. : 0,
                                        #ifdef HAVE_CPU_WAIT
-                                       systeminfo.total_cpu_wait_percent/10.,
+ systeminfo.total_cpu_wait_percent > 0 ? systeminfo.total_cpu_wait_percent/10. : 0,
                                        #endif
                                        systeminfo.total_mem_percent/10.,
                                        systeminfo.total_mem_kbyte,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]