[xiph-commits] r17239 - trunk/mgm/modules/linux

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Fri May 21 22:07:21 PDT 2010


Author: xiphmont
Date: 2010-05-21 22:07:21 -0700 (Fri, 21 May 2010)
New Revision: 17239

Modified:
   trunk/mgm/modules/linux/00helper
Log:
Give up and use localtime for interval parsing rather than ticks in /proc/stat



Modified: trunk/mgm/modules/linux/00helper
===================================================================
--- trunk/mgm/modules/linux/00helper	2010-05-22 05:06:39 UTC (rev 17238)
+++ trunk/mgm/modules/linux/00helper	2010-05-22 05:07:21 UTC (rev 17239)
@@ -14,6 +14,7 @@
 package MGMmodule::helperST;
 use vars qw(%disk26 %vm26 %proc %net %wi $lastmod $stat_active $net_active $active_if $wi_count $wi_active $vm_active $disk26_active);
 use IO::Seekable;
+use Time::HiRes qw( gettimeofday );
 
 sub module_init{
     my$this=shift;
@@ -131,9 +132,7 @@
     }
 
 
-    # what a great hack
-    $proc{"cpu"}=~m/(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/;
-    $lastmod=$1+$2+$3+$4; # 100ths of a second, even with 'broken' 2.0 SMP proc
+    $lastmod = [gettimeofday]*100;
 }
 
 bless {};



More information about the commits mailing list