|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.hammurapi.metrics.SlicingMeasurementConsumer
public class SlicingMeasurementConsumer
Slices metrics.
Field Summary | |
---|---|
protected long |
from
|
protected long |
to
|
Constructor Summary | |
---|---|
SlicingMeasurementConsumer()
Default constructor with default settings. |
|
SlicingMeasurementConsumer(long tick,
boolean keepMeasurements,
int maxQueue,
SliceConsumer sliceConsumer)
Creates a new instance with internal timer. |
|
SlicingMeasurementConsumer(long tick,
boolean keepMeasurements,
int maxQueue,
SliceConsumer sliceConsumer,
java.util.Timer timer)
Creates a new instance with internal timer. |
Method Summary | |
---|---|
void |
addMeasurement(java.lang.String name,
double value,
long time)
Adds measurement |
MeasurementConsumer |
getCategoryInstance(java.lang.String category)
|
int |
getMaxQueue()
|
protected SliceConsumer |
getSliceConsumer()
|
long |
getTick()
|
boolean |
isKeepMeasurements()
|
void |
setKeepMeasurements(boolean keepMeasurements)
|
void |
setMaxQueue(int maxQueue)
|
void |
setOwner(java.lang.Object owner)
Plugs the component into container and naming bus. |
void |
setSliceConsumer(SliceConsumer sliceConsumer)
|
void |
setTick(long tick)
|
void |
shutdown()
|
void |
start()
Increments use counter |
void |
stop()
Decrements use counter and invokes shutdown() when counter==0 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long from
protected long to
Constructor Detail |
---|
public SlicingMeasurementConsumer(long tick, boolean keepMeasurements, int maxQueue, SliceConsumer sliceConsumer)
tick
- Slice size in millisecondskeepMeasurements
- If true individual measurements are reported, only aggregated values otherwisemaxQueue
- Maximum number of slices pending to be consumed. 0 - no limit. If sampling ratio is higher than
consuming ration then excessive slices will be dropped with a notice on console.public SlicingMeasurementConsumer(long tick, boolean keepMeasurements, int maxQueue, SliceConsumer sliceConsumer, java.util.Timer timer)
tick
- Slice size in millisecondskeepMeasurements
- If true individual measurements are reported, only aggregated values otherwisemaxQueue
- Maximum number of slices pending to be consumed. 0 - no limit. If sampling ratio is higher than
consuming ration then excessive slices will be dropped with a notice on console.timer
- Timer to use for slicing metrics and passing them to slice consumer. If it is null then an internal timer is
created.public SlicingMeasurementConsumer()
Method Detail |
---|
protected SliceConsumer getSliceConsumer()
public void addMeasurement(java.lang.String name, double value, long time)
MeasurementConsumer
addMeasurement
in interface MeasurementConsumer
name
- Metric namevalue
- Measurement valuetime
- Time when metric was collected. If this
parameter is 0 then metric subsystem uses
System.currentTimeMillis() to provide correct value if
needed.public MeasurementConsumer getCategoryInstance(java.lang.String category)
category
-
public void shutdown()
public void start() throws ConfigurationException
start
in interface Component
ConfigurationException
public void stop() throws ConfigurationException
stop
in interface Component
ConfigurationException
public void setOwner(java.lang.Object owner)
Component
setOwner
in interface Component
public int getMaxQueue()
public void setMaxQueue(int maxQueue)
public long getTick()
public void setTick(long tick)
public void setSliceConsumer(SliceConsumer sliceConsumer)
public boolean isKeepMeasurements()
public void setKeepMeasurements(boolean keepMeasurements)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |