|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.netflix.stats.distribution.DataAccumulator
public abstract class DataAccumulator
A double-buffer of DataBuffer objects.
One is the "current" buffer, and new data is added to it.
The other is the "previous" buffer, and is used as a sorce
of computed statistics.
DataPublisher| Constructor Summary | |
|---|---|
DataAccumulator(int bufferSize)
Creates a new initially empty DataAccumulator. |
|
| Method Summary | |
|---|---|
void |
noteValue(double val)
Adds a value to the collected data. |
void |
publish()
Swaps the data collection buffers, and computes statistics about the data collected up til now. |
protected abstract void |
publish(DataBuffer buf)
Called to publish recently collected data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataAccumulator(int bufferSize)
bufferSize - the size of the buffers to use| Method Detail |
|---|
public void noteValue(double val)
noteValue in interface DataCollectorpublic void publish()
protected abstract void publish(DataBuffer buf)
Lock associated with the "previous"
buffer is held, so the data will not be changed.
Other locks have been released, and so new data can be
collected in the "current" buffer.
The data in the buffer has also been sorted in increasing order.
buf - the DataBuffer that is now "previous".
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||