Map<String, GcTimes> gcTimesBeforeSleep = getGcTimes(); while (shouldRun) { sw.reset().start(); try { Thread.sleep(SLEEP_INTERVAL_MS);
@Override protected int doWork() throws Exception { generateRegionsAndServers(); String methodName = "roundRobinAssignment"; LOG.info("Calling " + methodName); Stopwatch watch = Stopwatch.createStarted(); loadBalancer.roundRobinAssignment(regions, servers); System.out.print(formatResults(methodName, watch.elapsed(TimeUnit.MILLISECONDS))); methodName = "retainAssignment"; LOG.info("Calling " + methodName); watch.reset().start(); loadBalancer.retainAssignment(regionServerMap, servers); System.out.print(formatResults(methodName, watch.elapsed(TimeUnit.MILLISECONDS))); methodName = "balanceCluster"; LOG.info("Calling " + methodName); watch.reset().start(); loadBalancer.balanceCluster(serverRegionMap); System.out.print(formatResults(methodName, watch.elapsed(TimeUnit.MILLISECONDS))); return EXIT_SUCCESS; }
if (i % printInterval == 0) { LOG.info("Get " + printInterval + "/" + stopWatch.elapsed(java.util.concurrent.TimeUnit.MILLISECONDS)); stopWatch.reset(); stopWatch.start(); if (i % printInterval == 0) { LOG.info("Put " + printInterval + "/" + stopWatch.elapsed(java.util.concurrent.TimeUnit.MILLISECONDS)); stopWatch.reset(); stopWatch.start();
if (i % printInterval == 0) { LOG.info("Get " + printInterval + "/" + stopWatch.elapsed(java.util.concurrent.TimeUnit.MILLISECONDS)); stopWatch.reset(); stopWatch.start(); if (i % printInterval == 0) { LOG.info("Put " + printInterval + "/" + stopWatch.elapsed(java.util.concurrent.TimeUnit.MILLISECONDS)); stopWatch.reset(); stopWatch.start();
@Override protected int doWork() throws Exception { generateRegionsAndServers(); String methodName = "roundRobinAssignment"; LOG.info("Calling " + methodName); Stopwatch watch = Stopwatch.createStarted(); loadBalancer.roundRobinAssignment(regions, servers); System.out.print(formatResults(methodName, watch.elapsed(TimeUnit.MILLISECONDS))); methodName = "retainAssignment"; LOG.info("Calling " + methodName); watch.reset().start(); loadBalancer.retainAssignment(regionServerMap, servers); System.out.print(formatResults(methodName, watch.elapsed(TimeUnit.MILLISECONDS))); methodName = "balanceCluster"; LOG.info("Calling " + methodName); watch.reset().start(); loadBalancer.balanceCluster(serverRegionMap); System.out.print(formatResults(methodName, watch.elapsed(TimeUnit.MILLISECONDS))); return EXIT_SUCCESS; }