Java AtomicLong getBench(Map times, int amount)

Here you can find the source of getBench(Map times, int amount)

Description

get Bench

License

Apache License

Declaration

private static String getBench(Map<String, AtomicLong> times, int amount) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.*;
import java.util.concurrent.atomic.AtomicLong;

public class Main {
    private static String getBench(Map<String, AtomicLong> times, int amount) {
        long fullScanElapsed = times.get("FullScan").get();
        StringBuilder result = new StringBuilder("<b>MicroBench</b> FullScan(ms):"
                + (fullScanElapsed / amount) / 1000 + "  <br><b> Breakdown(%):</b><br>");
        for (String key : times.keySet()) {
            long totalNanos = times.get(key).get();
            result.append(key).append(":")
                    .append(Math.round((((double) totalNanos / (double) fullScanElapsed) * 100.0))).append("<br>");
        }/* ww w.  ja va2 s  .  c  o m*/
        return result.toString();
    }
}

Related

  1. get(T stat, AtomicIntegerFieldUpdater updater, boolean reset)
  2. getAndAddCap(AtomicLongFieldUpdater updater, T instance, long n)
  3. getAndAddRequest(AtomicLong requested, long n)
  4. getAndAddRequest(AtomicLongFieldUpdater requested, T object, long n)
  5. getAtomicLongArraySameLengthAsList(List list)
  6. getDateSafe()
  7. getForeverUniqueID()
  8. getGlobalTimeStamp()
  9. getList(AtomicLongArray atomicLongArray)