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()
CompoundOperation
type
in interface CompoundOperation<T extends Enum<T>>
public Result component(T result)
CompoundOperation
component
in interface CompoundOperation<T extends Enum<T>>
result
- the resultpublic Result compound(Set<T> results)
CompoundOperation
compound
in interface CompoundOperation<T extends Enum<T>>
results
- the resultspublic CountOperation<T> asCountOperation()
CompoundOperation
asCountOperation
in interface CompoundOperation<T extends Enum<T>>
public SampledStatistic<Double> ratioOf(Set<T> numerator, Set<T> denominator)
CompoundOperation
ratioOf
in interface CompoundOperation<T extends Enum<T>>
numerator
- the numeratordenominator
- the denomiatorpublic void setAlwaysOn(boolean enable)
CompoundOperation
setAlwaysOn
in interface CompoundOperation<T extends Enum<T>>
enable
- the new always onpublic boolean isAlwaysOn()
CompoundOperation
isAlwaysOn
in interface CompoundOperation<T extends Enum<T>>
public void setWindow(long time, TimeUnit unit)
CompoundOperation
setWindow
in interface CompoundOperation<T extends Enum<T>>
time
- the timeunit
- the unitpublic void setHistory(int samples, long time, TimeUnit unit)
CompoundOperation
setHistory
in interface CompoundOperation<T extends Enum<T>>
samples
- the samplestime
- the timeunit
- the unitpublic long getWindowSize(TimeUnit unit)
CompoundOperation
getWindowSize
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 © 2018. All rights reserved.