cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [3/3] git commit: updated refs/heads/4.3 to 5cd0d25
Date Thu, 20 Nov 2014 14:17:13 GMT
CLOUDSTACK-3383: Fetch CPU utilization more reliable.

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

(cherry picked from commit 69ee01af9df8d72ccd8901d146726e74edda95d7)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java


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

Branch: refs/heads/4.3
Commit: 5cd0d258126a1ce78113c09c5e1ebe832110f2ee
Parents: 56d8b17
Author: Wido den Hollander <wido@widodh.nl>
Authored: Tue Nov 11 16:49:38 2014 +0100
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Thu Nov 20 19:41:53 2014 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5cd0d258/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 ab7b9b5..dbd2327 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
@@ -3120,8 +3120,7 @@ ServerResource {
     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