rpms/vhostmd/devel vhostmd.conf,1.5,1.6 vhostmd.spec,1.12,1.13

Richard W.M. Jones rjones at fedoraproject.org
Tue Apr 27 10:39:00 UTC 2010


Author: rjones

Update of /cvs/pkgs/rpms/vhostmd/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv22474

Modified Files:
	vhostmd.conf vhostmd.spec 
Log Message:
Updated vhostmd.conf file which enables TotalCPUTime metric.


Index: vhostmd.conf
===================================================================
RCS file: /cvs/pkgs/rpms/vhostmd/devel/vhostmd.conf,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- vhostmd.conf	10 Dec 2009 17:27:55 -0000	1.5
+++ vhostmd.conf	27 Apr 2010 10:39:00 -0000	1.6
@@ -150,13 +150,28 @@ within the vm element.
       <variable name="PageInRate" type="uint64"/>
       <variable name="PageFaultRate" type="uint64"/>
     </metric>
-    <!--<metric type="real64" context="host">
+    <metric type="real64" context="host">
       <name>TotalCPUTime</name>
       <action>
-        virsh -r CONNECT dominfo 0 | sed 's/: */:/'   \
-          | gawk -F: '/CPU time/ {print $2;}'
+        gawk 'BEGIN {
+          getline &lt; "/proc/uptime";
+          idle_sec  = $2;
+          while ( 0 &lt;= (getline &lt; "/proc/stat") )
+          {
+            if ( "cpu" == $1 )
+            {
+              USER_HZ = $5/idle_sec;
+              #printf "USER_HZ = %f\n", USER_HZ | "cat 1&gt;&amp;2"
+              TotalCPUTime = ($2 + $3 + $4)/USER_HZ;
+              printf "%f\n", TotalCPUTime;
+
+              break;
+            }
+          }
+          #close("cat 1&gt;&amp;2");
+        }'
       </action>
-    </metric>-->
+    </metric>
     <!-- SAP "CIM"  -->
     <metric type="real64" context="vm">
       <name>TotalCPUTime</name>


Index: vhostmd.spec
===================================================================
RCS file: /cvs/pkgs/rpms/vhostmd/devel/vhostmd.spec,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- vhostmd.spec	16 Feb 2010 15:57:28 -0000	1.12
+++ vhostmd.spec	27 Apr 2010 10:39:00 -0000	1.13
@@ -8,7 +8,7 @@
 Summary:       Virtualization host metrics daemon
 Name:          vhostmd
 Version:       0.4
-Release:       5%{?dist}
+Release:       6%{?dist}
 License:       GPLv2+
 Group:         System Environment/Daemons
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -192,6 +192,9 @@ exit 0
 
 
 %changelog
+* Tue Apr 27 2010 Richard W.M. Jones <rjones at redhat.com> - 0.4-6
+- Updated vhostmd.conf file which enables TotalCPUTime metric.
+
 * Tue Feb 16 2010 Richard W.M. Jones <rjones at redhat.com> - 0.4-5
 - Add a patch to link tests explicitly with -ldl (RHBZ#565096).
 



More information about the scm-commits mailing list