T - the generic typepublic class CompoundOperationImpl<T extends Enum<T>> extends Object implements CompoundOperation<T>
| Constructor and Description |
|---|
CompoundOperationImpl(OperationStatistic<T> source,
Class<T> type,
long averagePeriod,
TimeUnit averageTimeUnit,
ScheduledExecutorService executor,
int historySize,
long historyPeriod,
TimeUnit historyTimeUnit)
Instantiates a new compound operation impl.
|
| Modifier and Type | Method and Description |
|---|---|
CountOperation<T> |
asCountOperation()
Count operation.
|
Result |
component(T result)
Component.
|
Result |
compound(Set<T> results)
Compound.
|
boolean |
expire(long expiryTime)
Expire.
|
int |
getHistorySampleSize()
Get the history sample size.
|
long |
getHistorySampleTime(TimeUnit unit)
Get the history sample time.
|
long |
getWindowSize(TimeUnit unit)
Gets the window size.
|
boolean |
isAlwaysOn()
Checks if is always on.
|
SampledStatistic<Double> |
ratioOf(Set<T> numerator,
Set<T> denominator)
Ratio of.
|
void |
setAlwaysOn(boolean enable)
Sets the always on.
|
void |
setHistory(int samples,
long time,
TimeUnit unit)
Sets the history.
|
void |
setWindow(long time,
TimeUnit unit)
Sets the window.
|
Class<T> |
type()
Type.
|
public CompoundOperationImpl(OperationStatistic<T> source, Class<T> type, long averagePeriod, TimeUnit averageTimeUnit, ScheduledExecutorService executor, int historySize, long historyPeriod, TimeUnit historyTimeUnit)
source - the sourcetype - the typeaveragePeriod - the average periodaverageTimeUnit - the average unitexecutor - the executorhistorySize - the history sizehistoryPeriod - the history periodhistoryTimeUnit - the history unitpublic Class<T> type()
CompoundOperationtype in interface CompoundOperation<T extends Enum<T>>public Result component(T result)
CompoundOperationcomponent in interface CompoundOperation<T extends Enum<T>>result - the resultpublic Result compound(Set<T> results)
CompoundOperationcompound in interface CompoundOperation<T extends Enum<T>>results - the resultspublic CountOperation<T> asCountOperation()
CompoundOperationasCountOperation in interface CompoundOperation<T extends Enum<T>>public SampledStatistic<Double> ratioOf(Set<T> numerator, Set<T> denominator)
CompoundOperationratioOf in interface CompoundOperation<T extends Enum<T>>numerator - the numeratordenominator - the denomiatorpublic void setAlwaysOn(boolean enable)
CompoundOperationsetAlwaysOn in interface CompoundOperation<T extends Enum<T>>enable - the new always onpublic boolean isAlwaysOn()
CompoundOperationisAlwaysOn in interface CompoundOperation<T extends Enum<T>>public void setWindow(long time,
TimeUnit unit)
CompoundOperationsetWindow in interface CompoundOperation<T extends Enum<T>>time - the timeunit - the unitpublic void setHistory(int samples,
long time,
TimeUnit unit)
CompoundOperationsetHistory in interface CompoundOperation<T extends Enum<T>>samples - the samplestime - the timeunit - the unitpublic long getWindowSize(TimeUnit unit)
CompoundOperationgetWindowSize in interface CompoundOperation<T extends Enum<T>>unit - the unitpublic int getHistorySampleSize()
getHistorySampleSize in interface CompoundOperation<T extends Enum<T>>public long getHistorySampleTime(TimeUnit unit)
getHistorySampleTime in interface CompoundOperation<T extends Enum<T>>unit - the unitpublic boolean expire(long expiryTime)
expiryTime - the expiry timeCopyright © 2019. All rights reserved.