From e4f7fb74efe56cafb67642eebef745c671a6454c Mon Sep 17 00:00:00 2001 From: wilderrodrigues Date: Thu, 25 Jun 2015 08:01:51 +0200 Subject: [PATCH] Using Profiler class, from the utils package, instead of System.currentTimeMillis() Signed-off-by: wilderrodrigues This closes #524 --- .../cluster/src/com/cloud/cluster/ClusterManagerImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java b/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java index 02597c34464..a9b01d49843 100644 --- a/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java +++ b/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java @@ -261,11 +261,15 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C pdu.getSequenceId() + ", pdu ack seq: " + pdu.getAckSequenceId() + ", json: " + pdu.getJsonPackage()); } - final long startTick = System.currentTimeMillis(); + final Profiler profiler = new Profiler(); + profiler.start(); + final String strResult = peerService.execute(pdu); + profiler.stop(); + if (s_logger.isDebugEnabled()) { s_logger.debug("Cluster PDU " + getSelfPeerName() + " -> " + pdu.getDestPeer() + " completed. time: " + - (System.currentTimeMillis() - startTick) + "ms. agent: " + pdu.getAgentId() + ", pdu seq: " + pdu.getSequenceId() + + profiler.getDurationInMillis() + "ms. agent: " + pdu.getAgentId() + ", pdu seq: " + pdu.getSequenceId() + ", pdu ack seq: " + pdu.getAckSequenceId() + ", json: " + pdu.getJsonPackage()); }