org.terracotta.statistics.extended
Class CompoundOperationImpl<T extends Enum<T>>

java.lang.Object
  extended by org.terracotta.statistics.extended.CompoundOperationImpl<T>
Type Parameters:
T - the generic type
All Implemented Interfaces:
CompoundOperation<T>

public class CompoundOperationImpl<T extends Enum<T>>
extends Object
implements CompoundOperation<T>

The Class CompoundOperationImpl.

Author:
cdennis

Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundOperationImpl

public 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.

Parameters:
source - the source
type - the type
averagePeriod - the average period
averageTimeUnit - the average unit
executor - the executor
historySize - the history size
historyPeriod - the history period
historyTimeUnit - the history unit
Method Detail

type

public Class<T> type()
Description copied from interface: CompoundOperation
Type.

Specified by:
type in interface CompoundOperation<T extends Enum<T>>
Returns:
the class

component

public Result component(T result)
Description copied from interface: CompoundOperation
Component.

Specified by:
component in interface CompoundOperation<T extends Enum<T>>
Parameters:
result - the result
Returns:
the result

compound

public Result compound(Set<T> results)
Description copied from interface: CompoundOperation
Compound.

Specified by:
compound in interface CompoundOperation<T extends Enum<T>>
Parameters:
results - the results
Returns:
the result

asCountOperation

public CountOperation<T> asCountOperation()
Description copied from interface: CompoundOperation
Count operation.

Specified by:
asCountOperation in interface CompoundOperation<T extends Enum<T>>
Returns:
the count operation

ratioOf

public SampledStatistic<Double> ratioOf(Set<T> numerator,
                                        Set<T> denominator)
Description copied from interface: CompoundOperation
Ratio of.

Specified by:
ratioOf in interface CompoundOperation<T extends Enum<T>>
Parameters:
numerator - the numerator
denominator - the denomiator
Returns:
the statistic

setAlwaysOn

public void setAlwaysOn(boolean enable)
Description copied from interface: CompoundOperation
Sets the always on.

Specified by:
setAlwaysOn in interface CompoundOperation<T extends Enum<T>>
Parameters:
enable - the new always on

isAlwaysOn

public boolean isAlwaysOn()
Description copied from interface: CompoundOperation
Checks if is always on.

Specified by:
isAlwaysOn in interface CompoundOperation<T extends Enum<T>>
Returns:
true, if is always on

setWindow

public void setWindow(long time,
                      TimeUnit unit)
Description copied from interface: CompoundOperation
Sets the window.

Specified by:
setWindow in interface CompoundOperation<T extends Enum<T>>
Parameters:
time - the time
unit - the unit

setHistory

public void setHistory(int samples,
                       long time,
                       TimeUnit unit)
Description copied from interface: CompoundOperation
Sets the history.

Specified by:
setHistory in interface CompoundOperation<T extends Enum<T>>
Parameters:
samples - the samples
time - the time
unit - the unit

getWindowSize

public long getWindowSize(TimeUnit unit)
Description copied from interface: CompoundOperation
Gets the window size.

Specified by:
getWindowSize in interface CompoundOperation<T extends Enum<T>>
Parameters:
unit - the unit
Returns:
the window size

getHistorySampleSize

public int getHistorySampleSize()
Get the history sample size.

Specified by:
getHistorySampleSize in interface CompoundOperation<T extends Enum<T>>
Returns:
the history sample size

getHistorySampleTime

public long getHistorySampleTime(TimeUnit unit)
Get the history sample time.

Specified by:
getHistorySampleTime in interface CompoundOperation<T extends Enum<T>>
Parameters:
unit - the unit
Returns:
the history sample time

expire

public boolean expire(long expiryTime)
Expire.

Parameters:
expiryTime - the expiry time
Returns:
true, if successful


Copyright © 2015. All Rights Reserved.