public class TimeTracker extends Object
| Constructor and Description |
|---|
TimeTracker() |
| Modifier and Type | Method and Description |
|---|---|
static void |
accumulate(String identifier,
long nanoTime)
Accumulate the given duration into the statistics with the given identifier
|
static void |
accumulate(String identifier,
NanoTimer timer)
Accumulate the given duration into the statistics with the given identifier
|
static void |
accumulate(String identifier,
Timer timer)
Accumulate the given duration into the statistics with the given identifier
|
static void |
addMissing(Map<String,org.apache.commons.math.stat.descriptive.SummaryStatistics> timesToAdd)
Add any times from the given map that are not present in the
internal map to the internal map.
|
static String |
format(Map<String,org.apache.commons.math.stat.descriptive.SummaryStatistics> times)
Pretty-print a map of times
|
static String |
format(org.apache.commons.math.stat.descriptive.SummaryStatistics ss)
Pretty print a time
|
static Map<String,org.apache.commons.math.stat.descriptive.SummaryStatistics> |
getTimes()
Get a copy of all the accumulated data
|
static Map<String,org.apache.commons.math.stat.descriptive.SummaryStatistics> |
reset()
Reset all the previously accumulated times, returning them.
|
public TimeTracker()
public static void accumulate(String identifier, NanoTimer timer)
identifier - the identifiertimer - the timer to retrieve the dureation frompublic static void accumulate(String identifier, Timer timer)
identifier - the identifiertimer - the timer to retrieve the dureation frompublic static void accumulate(String identifier, long nanoTime)
identifier - the identifiernanoTime - the duration to accumulate in nano secondspublic static Map<String,org.apache.commons.math.stat.descriptive.SummaryStatistics> reset()
public static Map<String,org.apache.commons.math.stat.descriptive.SummaryStatistics> getTimes()
public static void addMissing(Map<String,org.apache.commons.math.stat.descriptive.SummaryStatistics> timesToAdd)
timesToAdd - the times to addpublic static String format(Map<String,org.apache.commons.math.stat.descriptive.SummaryStatistics> times)
times - the times