public class TimedCalls extends Object
Constructor and Description |
---|
TimedCalls() |
Modifier and Type | Method and Description |
---|---|
void |
addDuration(String name,
long duration)
Records duration with given name.
|
static TimedCalls |
clearInstance()
Detaches and returns instance for the current thread.
|
Map<String,Long> |
createDurationMap()
Returns map of timer name to it's total duration.
|
static TimedCalls |
createInstanceForCurrentThread()
Creates new instance and attaches it to the current thread.
|
void |
finishTimer()
Finishes timer and logs duration.
|
static TimedCalls |
getInstance()
Returns instance attached to the current thread.
|
List<String> |
getTopTimersToString(int count)
Returns string representations of longest timers.
|
List<String> |
getTopTimersToString(long totalTimeMs,
int count)
Returns string representations of longest timers.
|
void |
startTimer(String name)
Starts new timer.
|
public void addDuration(String name, long duration)
public void startTimer(String name)
public void finishTimer()
public Map<String,Long> createDurationMap()
public List<String> getTopTimersToString(int count)
public List<String> getTopTimersToString(long totalTimeMs, int count)
public static TimedCalls getInstance()
public static TimedCalls clearInstance()
public static TimedCalls createInstanceForCurrentThread()
Copyright © 2021 Atlassian. All rights reserved.