|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.utils.time.DurationCapture
public class DurationCapture
A DurationCapture will measure time intervals.
newInstance(),
DurationCaptureTypeFactory,
Serialized Form| Nested Class Summary | |
|---|---|
static class |
DurationCapture.Interval
Saves the interval points and their data like name and time. |
protected static class |
DurationCapture.IntervalStatistic
Internal class for statistical data calculated for the DurationCapture.Interval instances. |
| Field Summary | |
|---|---|
static Class<? extends DurationCapture> |
implementationForDurationClass
Used by the factory method. |
static Object |
INTERVAL_DEFAULTKEY
|
protected Map<Object,DurationCapture.Interval> |
intervalKeyToIntervalMap
|
| Constructor Summary | |
|---|---|
DurationCapture()
|
|
| Method Summary | |
|---|---|
String |
calculateIntervalStatisticLogMessage()
Returns the collected statistical informations for the intervals durations. |
protected Map<Object,DurationCapture.IntervalStatistic> |
calculateIntervalStatisticMap()
Calculates the statistical data for the interval and returns a map with the intervalKeys and a DurationCapture.IntervalStatistic
instance. |
protected DurationCapture.Interval |
determineInterval(Object key)
Returns an DurationCapture.Interval for the given key. |
long |
getDuration(Object intervalKey,
TimeUnit timeUnit)
Returns the needed time between measurement start and stop for the given interval key in the given TimeUnit. |
long |
getDuration(TimeUnit timeUnit)
Returns the needed time between measurement start and stop in the given TimeUnit. |
long |
getDuration(TimeUnit timeUnit,
Object... intervalKeys)
Returns the time duration sum between measurement start and stop in the given TimeUnit for all given interval keys. |
long |
getDurationInMilliseconds()
Returns the needed time between measurement start and stop in milliseconds. |
long |
getDurationInMilliseconds(Object... intervalKeys)
Returns the time duration sum between measurement start and stop in milliseconds for all given interval keys. |
long |
getDurationInMilliseconds(Object intervalKey)
Returns the needed time between measurement start and stop in milliseconds. |
long |
getInterimTime(Object intervalKey,
TimeUnit timeUnit)
Returns the time since starting the measurement and now in milliseconds for the given interval key in the given TimeUnit |
long |
getInterimTime(TimeUnit timeUnit)
Returns the time since starting the measurement and now in the given TimeUnit. |
long |
getInterimTime(TimeUnit timeUnit,
Object... intervalKeys)
Returns the time sum since starting the measurement and now in the given TimeUnit for all given interval keys. |
long |
getInterimTimeInMilliseconds()
Returns the time since starting the measurement and now in milliseconds. |
long |
getInterimTimeInMilliseconds(Object... intervalKeys)
Returns the time sum since starting the measurement and now in milliseconds for all given interval keys. |
long |
getInterimTimeInMilliseconds(Object intervalKey)
Returns the time since starting the measurement and now in milliseconds for the given interval key |
List<Object> |
getIntervalKeyList()
Returns all available DurationCapture.Interval keys. |
Map<Object,Long> |
getIntervalKeyToDurationInMillisecondsMap()
Returns a new Map instance with all DurationCapture.Interval keys and the related getDurationInMilliseconds(Object)
as value |
Map<Object,Long> |
getIntervalKeyToDurationMap(TimeUnit timeUnit)
Returns a new Map instance with all DurationCapture.Interval keys and the related getDuration(TimeUnit) as value |
protected boolean |
hasDefaultInterval()
Returns true, if there is an DurationCapture.Interval instance for the INTERVAL_DEFAULTKEY. |
static DurationCapture |
newInstance()
Creates a new instance of this class. |
void |
resetTimer()
Sets the timer of the default DurationCapture.Interval back to zero. |
void |
resetTimers()
Resets the timer of all contained DurationCapture.Interval instances. |
DurationCapture |
startTimeMeasurement()
Starts the measurement of time. |
DurationCapture |
startTimeMeasurement(Object intervalKey)
Starts the time measurement which will relate to the given key. |
DurationCapture |
stopTimeMeasurement()
Stops the measurement of the time for the default DurationCapture.Interval. |
DurationCapture |
stopTimeMeasurement(Object intervalKey)
Stops the time measurement for the respective DurationCapture.Interval. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Object INTERVAL_DEFAULTKEY
protected final Map<Object,DurationCapture.Interval> intervalKeyToIntervalMap
public static Class<? extends DurationCapture> implementationForDurationClass
newInstance()| Constructor Detail |
|---|
public DurationCapture()
DurationCapture| Method Detail |
|---|
public DurationCapture startTimeMeasurement(Object intervalKey)
intervalKey -
protected DurationCapture.Interval determineInterval(Object key)
DurationCapture.Interval for the given key.
key -
public DurationCapture startTimeMeasurement()
public void resetTimer()
DurationCapture.Interval back to zero.
public void resetTimers()
DurationCapture.Interval instances.
public DurationCapture stopTimeMeasurement()
DurationCapture.Interval.
public DurationCapture stopTimeMeasurement(Object intervalKey)
DurationCapture.Interval.
intervalKey -
protected Map<Object,DurationCapture.IntervalStatistic> calculateIntervalStatisticMap()
DurationCapture.IntervalStatistic
instance.
public long getDurationInMilliseconds()
getDurationInMilliseconds(Object)public long getDuration(TimeUnit timeUnit)
TimeUnit.
timeUnit -
getDurationInMilliseconds(Object)public long getDurationInMilliseconds(Object intervalKey)
intervalKey -
getDurationInMilliseconds()
public long getDuration(Object intervalKey,
TimeUnit timeUnit)
TimeUnit.
timeUnit -
getDurationInMilliseconds(Object)public long getDurationInMilliseconds(Object... intervalKeys)
getDurationInMilliseconds() is returned.
intervalKeys -
public long getDuration(TimeUnit timeUnit,
Object... intervalKeys)
TimeUnit for all given interval keys.
If no interval key is specified getDurationInMilliseconds() is returned.
timeUnit - intervalKeys -
public long getInterimTimeInMilliseconds()
public long getInterimTime(TimeUnit timeUnit)
TimeUnit.
timeUnit -
public long getInterimTimeInMilliseconds(Object intervalKey)
public long getInterimTime(Object intervalKey,
TimeUnit timeUnit)
TimeUnit
timeUnit - TimeUnit
public long getInterimTimeInMilliseconds(Object... intervalKeys)
getInterimTimeInMilliseconds() is returned instead.
intervalKeys -
public long getInterimTime(TimeUnit timeUnit,
Object... intervalKeys)
TimeUnit for all given interval keys. If no
interval key is given getInterimTime(TimeUnit) is returned instead.
timeUnit - TimeUnitintervalKeys -
protected boolean hasDefaultInterval()
DurationCapture.Interval instance for the INTERVAL_DEFAULTKEY.
public String calculateIntervalStatisticLogMessage()
public List<Object> getIntervalKeyList()
DurationCapture.Interval keys.
public Map<Object,Long> getIntervalKeyToDurationInMillisecondsMap()
Map instance with all DurationCapture.Interval keys and the related getDurationInMilliseconds(Object)
as value
public Map<Object,Long> getIntervalKeyToDurationMap(TimeUnit timeUnit)
Map instance with all DurationCapture.Interval keys and the related getDuration(TimeUnit) as value
timeUnit - TimeUnit
public static DurationCapture newInstance()
implementationForDurationClasspublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||