public class MutableTimeStatisticImpl extends Object implements TimeStatistic, MutableTimeStatistic
MutableTimeStatistic that eases the various
statistical calculations.| Constructor and Description |
|---|
MutableTimeStatisticImpl(TimeStatistic initial)
Constructs an instance of this class from its immutable equivalent.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getCount()
Number of times the operation was invoked since the beginning of this measurement.
|
String |
getDescription()
A human-readable description of the Statistic.
|
long |
getLastSampleTime()
The time of the last measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.
|
long |
getMaxTime()
The maximum amount of time taken to complete one invocation of this operation since the beginning of this measurement.
|
long |
getMinTime()
The minimum amount of time taken to complete one invocation of this operation since the beginning of this measurement.
|
String |
getName()
The name of this Statistic.
|
long |
getStartTime()
The time of the first measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.
|
long |
getTotalTime()
This is the sum total of time taken to complete every invocation of this operation since the beginning of this measurement.
|
String |
getUnit()
The unit of measurement for this Statistic.
|
void |
incrementCount(long current)
Increments the count of operation execution by 1 and also increases the time
consumed.
|
Statistic |
modifiableView()
Returns an instance of Statistic whose state can be changed by the caller.
|
void |
reset()
Resets the Statistic.
|
void |
setDescription(String s) |
Statistic |
unmodifiableView()
This method is the essence of this class.
|
public MutableTimeStatisticImpl(TimeStatistic initial)
instance - of (immutable) TimeStatisticpublic void incrementCount(long current)
incrementCount in interface MutableTimeStatisticcurrent - long indicating time in whatever unit this statistic is calculatedpublic void reset()
reset in interface MutableStatisticpublic Statistic unmodifiableView()
unmodifiableView in interface MutableStatisticTimeStatisticpublic Statistic modifiableView()
MutableStatisticmodifiableView in interface MutableStatisticpublic long getCount()
TimeStatisticgetCount in interface TimeStatisticpublic String getDescription()
StatisticgetDescription in interface Statisticpublic long getLastSampleTime()
StatisticgetLastSampleTime in interface Statisticpublic long getMaxTime()
TimeStatisticgetMaxTime in interface TimeStatisticpublic long getMinTime()
TimeStatisticgetMinTime in interface TimeStatisticpublic String getName()
Statisticpublic long getStartTime()
StatisticgetStartTime in interface Statisticpublic long getTotalTime()
TimeStatisticgetTotalTime in interface TimeStatisticpublic String getUnit()
Statisticpublic void setDescription(String s)
Copyright © 2017–2019 Eclipse Foundation. All rights reserved.