You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ek...@apache.org on 2015/06/08 11:46:04 UTC

[43/50] [abbrv] git commit: updated refs/heads/feature/vpc-ipv6 to 6140db5

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 <da...@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/feature/vpc-ipv6
Commit: 38c269d71e40200cd27bfd9d1187ec25fcd8b6fa
Parents: 65383fb
Author: Rafael da Fonseca <rs...@gmail.com>
Authored: Sun Jun 7 21:23:09 2015 +0200
Committer: Daan Hoogland <da...@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);