cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/master to 38c269d
Date Mon, 08 Jun 2015 07:32:49 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 65383fb8f -> 38c269d71


Fix performance issue reported by findbugs (unnescessary boxing/unboxing) VmwareResource.java:693,
DM_BOXED_PRIMITIVE_FOR_PARSING, Priority: High VmwareResource.java:4769, DM_BOXED_PRIMITIVE_FOR_PARSING,
Priority: High Boxing/unboxing to parse a primitive com.cloud.hypervisor.vmware.resource.VmwareResource.getNetworkStats(String)

Now op is faster and takes up less memory

Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #365


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

Branch: refs/heads/master
Commit: 38c269d71e40200cd27bfd9d1187ec25fcd8b6fa
Parents: 65383fb
Author: Rafael da Fonseca <rsafonseca@gmail.com>
Authored: Sun Jun 7 21:23:09 2015 +0200
Committer: Daan Hoogland <daan.hoogland@gmail.com>
Committed: Mon Jun 8 09:32:52 2015 +0200

----------------------------------------------------------------------
 .../com/cloud/hypervisor/vmware/resource/VmwareResource.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/38c269d7/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 83c17dc..f7c6db3 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -690,8 +690,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
                 String[] splitResult = result.split(":");
                 int i = 0;
                 while (i < splitResult.length - 1) {
-                    stats[0] += (new Long(splitResult[i++])).longValue();
-                    stats[1] += (new Long(splitResult[i++])).longValue();
+                    stats[0] += Long.parseLong(splitResult[i++]);
+                    stats[1] += Long.parseLong(splitResult[i++]);
                 }
                 return new NetworkUsageAnswer(cmd, "success", stats[0], stats[1]);
             }
@@ -4766,8 +4766,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
                 String[] splitResult = result.split(":");
                 int i = 0;
                 while (i < splitResult.length - 1) {
-                    stats[0] += (new Long(splitResult[i++])).longValue();
-                    stats[1] += (new Long(splitResult[i++])).longValue();
+                    stats[0] += Long.parseLong(splitResult[i++]);
+                    stats[1] += Long.parseLong(splitResult[i++]);
                 }
             } catch (Throwable e) {
                 s_logger.warn("Unable to parse return from script return of network usage
command: " + e.toString(), e);


Mime
View raw message