public final class OpSnapshot extends Object implements OpInstrument
Its IMMUTABLE and hence THREAD safe.
| Constructor and Description |
|---|
OpSnapshot(String name,
long invocationCount,
long elapsedTotal,
long elapsedMin,
long elapsedMax,
long resultSetSize,
long cpuTotal,
long cpuMin,
long cpuMax)
Constructs a OpSnapshot with the specified values.
|
| Modifier and Type | Method and Description |
|---|---|
OpSnapshot |
add(OpSnapshot otherOpSnapshot)
Adds the values in the otherOpSnapshot to the current one and returns a new object repsentation of itself.
|
int |
compareTo(Instrument that)
By default it sorts in name / highest time taken / highest invocation count / highest result set size order
|
static OpSnapshot |
createSingle(String name,
long elapsedTime,
long resultSetSize,
long cpuTime) |
boolean |
equals(Object o) |
long |
getCpuMaxTime(TimeUnit unit) |
long |
getCpuMinTime(TimeUnit unit) |
long |
getCpuTime() |
long |
getCpuTotalTime(TimeUnit unit) |
long |
getElapsedMaxTime(TimeUnit unit) |
long |
getElapsedMinTime(TimeUnit unit) |
long |
getElapsedTotalTime(TimeUnit unit) |
long |
getInvocationCount() |
long |
getMillisecondsTaken() |
String |
getName() |
long |
getResultSetSize() |
long |
getValue()
This is a synonym for
getElapsedTotalTime(java.util.concurrent.TimeUnit) with milliseconds |
int |
hashCode() |
OpSnapshot |
substract(OpSnapshot previousSnapshot)
This can be used to find out the difference between this snapshot and a previous one
|
String |
toString() |
public OpSnapshot(String name, long invocationCount, long elapsedTotal, long elapsedMin, long elapsedMax, long resultSetSize, long cpuTotal, long cpuMin, long cpuMax)
public static OpSnapshot createSingle(String name, long elapsedTime, long resultSetSize, long cpuTime)
public String getName()
getName in interface Instrumentpublic long getInvocationCount()
getInvocationCount in interface OpInstrumentpublic long getMillisecondsTaken()
getMillisecondsTaken in interface OpInstrumentpublic long getElapsedTotalTime(TimeUnit unit)
getElapsedTotalTime in interface OpInstrumentunit - the unit to express the time withpublic long getElapsedMinTime(TimeUnit unit)
getElapsedMinTime in interface OpInstrumentunit - the unit to express the time withpublic long getElapsedMaxTime(TimeUnit unit)
getElapsedMaxTime in interface OpInstrumentunit - the unit to express the time withpublic long getResultSetSize()
getResultSetSize in interface OpInstrumentpublic long getCpuTime()
getCpuTime in interface OpInstrumentpublic long getCpuTotalTime(TimeUnit unit)
getCpuTotalTime in interface OpInstrumentunit - the unit to express the time withpublic long getCpuMinTime(TimeUnit unit)
getCpuMinTime in interface OpInstrumentunit - the unit to express the time withpublic long getCpuMaxTime(TimeUnit unit)
getCpuMaxTime in interface OpInstrumentunit - the unit to express the time withpublic long getValue()
getElapsedTotalTime(java.util.concurrent.TimeUnit) with millisecondsgetValue in interface Instrumentpublic int compareTo(Instrument that)
compareTo in interface Comparable<Instrument>that - the object tom comparepublic OpSnapshot substract(OpSnapshot previousSnapshot)
previousSnapshot - a previous snapshotpublic OpSnapshot add(OpSnapshot otherOpSnapshot)
otherOpSnapshot - the one to add to this snapshotCopyright © 2016 Atlassian. All rights reserved.