cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject git commit: updated refs/heads/hotfix/3383 to ce7a4e2
Date Tue, 11 Nov 2014 15:51:08 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/hotfix/3383 [created] ce7a4e245


CLOUDSTACK-3383: Fetch CPU utilization more reliable.

This should fix that we can't gather CPU statistics on hypervisors
> Ubuntu 12.04


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ce7a4e24
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ce7a4e24
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ce7a4e24

Branch: refs/heads/hotfix/3383
Commit: ce7a4e2455289764779f8ebe4504125c5e9fb6a7
Parents: edf1047
Author: Wido den Hollander <wido@widodh.nl>
Authored: Tue Nov 11 16:49:38 2014 +0100
Committer: Wido den Hollander <wido@widodh.nl>
Committed: Tue Nov 11 16:49:38 2014 +0100

----------------------------------------------------------------------
 .../cloud/hypervisor/kvm/resource/LibvirtComputingResource.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ce7a4e24/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 62c1b53..9bd256a 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -3253,7 +3253,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
     private Answer execute(GetHostStatsCommand cmd) {
         final Script cpuScript = new Script("/bin/bash", s_logger);
         cpuScript.add("-c");
-        cpuScript.add("idle=$(top -b -n 1|grep Cpu\\(s\\):|cut -d% -f4|cut -d, -f2);echo
$idle");
+        cpuScript.add("idle=$(top -b -n 1| awk -F, '/^[%]*[Cc]pu/{$0=$4; gsub(/[^0-9.,]+/,"");
print }'); echo $idle");
 
         final OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser();
         String result = cpuScript.execute(parser);


Mime
View raw message