etm.core.aggregation
Class BufferedThresholdAggregator

java.lang.Object
  extended by etm.core.aggregation.BufferedThresholdAggregator
All Implemented Interfaces:
Aggregator

public class BufferedThresholdAggregator
extends java.lang.Object
implements Aggregator

The BufferedThresholdAggregator wraps an Aggregator instance and prevents processing of every measurement result by buffering them until specified threshold is reached. If this threshold is reached all buffered measurements will be flushed to the underlying aggregator.

Please note that this aggregator may have a direct impact on executing threads since the thread that reaches the threshold is used to aggregate the results. If you want to minimize this effect use an interval based buffering aggregator BufferedTimedAggregator.

Version:
$Revision: 209 $
Author:
void.fm

Field Summary
protected  etm.core.aggregation.BufferedThresholdAggregator.BoundedBuffer buffer
           
protected  Aggregator delegate
           
protected  int threshold
           
 
Constructor Summary
BufferedThresholdAggregator(Aggregator aAggregator)
          Creates a new BufferedThresholdAggregator for the given aggregator instance.
 
Method Summary
 void add(EtmPoint point)
          Adds a new EtmPoint to the aggregator.
 void flush()
          Flushes the current aggregation details.
 AggregatorMetaData getMetaData()
          Returns detailed information about the aggregator chain.
 void init(EtmMonitorContext ctx)
          Lifecycle Method, will be called before Aggregator.start(), after initalization of the current EtmMonitor runtime.
 void render(MeasurementRenderer renderer)
          Renders the current state of the aggregator using the provided renderer instance.
 void reset()
          Resets the internal aggregator state.
 void reset(java.lang.String symbolicName)
          Resets the internal aggregator state for a etm point.
 void setThreshold(int aThreshold)
          Sets the threshold to the given value.
 void start()
          Lifecycle method, will be called after all Aggregator instances are initialized by calling Aggregator.init(etm.core.monitor.EtmMonitorContext) and before the EtmMonitor instance will becomes available.
 void stop()
          Lifecycle method, will be called after the EtmMonitor instance was shutdown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected final Aggregator delegate

threshold

protected int threshold

buffer

protected etm.core.aggregation.BufferedThresholdAggregator.BoundedBuffer buffer
Constructor Detail

BufferedThresholdAggregator

public BufferedThresholdAggregator(Aggregator aAggregator)
Creates a new BufferedThresholdAggregator for the given aggregator instance. Uses the default threshold size of 1000 elements.

Parameters:
aAggregator - The underlying aggregator.
Method Detail

setThreshold

public void setThreshold(int aThreshold)
Sets the threshold to the given value.

Parameters:
aThreshold - The threshold.
Throws:
java.lang.IllegalArgumentException - Thrown for threshold sizes < 1000.

add

public void add(EtmPoint point)
Description copied from interface: Aggregator
Adds a new EtmPoint to the aggregator.

Specified by:
add in interface Aggregator
Parameters:
point - A new collected EtmPoint.

flush

public void flush()
Description copied from interface: Aggregator
Flushes the current aggregation details. Buffering Aggragetors should clean up their process buffer.

Specified by:
flush in interface Aggregator

reset

public void reset()
Description copied from interface: Aggregator
Resets the internal aggregator state. Persistent states usually aren't affected.

Specified by:
reset in interface Aggregator

reset

public void reset(java.lang.String symbolicName)
Description copied from interface: Aggregator
Resets the internal aggregator state for a etm point. Persistent states usually aren't affected.

Specified by:
reset in interface Aggregator
Parameters:
symbolicName - The name of the etm point to be resetted.

render

public void render(MeasurementRenderer renderer)
Description copied from interface: Aggregator
Renders the current state of the aggregator using the provided renderer instance.

Specified by:
render in interface Aggregator
Parameters:
renderer - The renderer.

getMetaData

public AggregatorMetaData getMetaData()
Description copied from interface: Aggregator
Returns detailed information about the aggregator chain.

Specified by:
getMetaData in interface Aggregator
Returns:
The AggregatorMetaData.

init

public void init(EtmMonitorContext ctx)
Description copied from interface: Aggregator
Lifecycle Method, will be called before Aggregator.start(), after initalization of the current EtmMonitor runtime. Be aware that Plugins are instantiated, but not started at this point.

Specified by:
init in interface Aggregator
Parameters:
ctx - The current EtmMonitor Context.

start

public void start()
Description copied from interface: Aggregator
Lifecycle method, will be called after all Aggregator instances are initialized by calling Aggregator.init(etm.core.monitor.EtmMonitorContext) and before the EtmMonitor instance will becomes available.

Specified by:
start in interface Aggregator

stop

public void stop()
Description copied from interface: Aggregator
Lifecycle method, will be called after the EtmMonitor instance was shutdown.

Specified by:
stop in interface Aggregator


Copyright © 2004,2005, 2006, 2007 void.fm. All Rights Reserved.