|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ostore.network.patchwork.PatchworkTable
The PatchworkTable
is built by the Patchwork
code, and is used for collecting statistics about other nodes.
It remembers observations sent to it and when recalculate
is called it produces a PatchworkTable.Delta
that contains
the difference between the current model and the last one produced from
a call to recalculate
.
It combines new and old statistics using weighted function, where the new statistic is considered as important as the "alpha" value, default at 80%.
It only considers a change worthy of noting if it is greater than some threshold, default at 1%.
Currently, the measurement types are as follows:
latency (in microseconds): Patch.LATENCY
bandwidth: Patch.BANDWIDTH
loss (in percent, from 0 to 100, where 100 is complete loss):
Patch.LOSS
Inner Class Summary | |
static class |
PatchworkTable.Delta
A PatchworkTable.Delta object contains a diff
of the sufficient statistics for a PatchworkTable . |
static class |
PatchworkTable.Observation
A Patchwork.Observation object contains an
observation recorded by the patchwork stage. |
Constructor Summary | |
PatchworkTable()
Create a new PatchworkTable . |
|
PatchworkTable(InputBuffer buffer)
|
Method Summary | |
void |
add_delta(PatchworkTable.Delta d)
Update this copy of a table with a delta produced by Patchwork |
protected double |
getAlpha()
How important is the current value of a statistic when calculating overall statistics? |
PatchworkStats |
getStats(NodeId peer,
byte type)
Get the current statistic data structure for a node. |
protected double |
getThreshold()
How much does a statistic need to change for it to be considered worthy of recording? |
protected boolean |
initStat(NodeId peer,
byte type,
long value)
Initialize a value for some statistic, only if no values have yet been recorded. |
protected PatchworkTable.Delta |
recalculate()
Specified by ostore.oil.Model interface |
protected void |
record(PatchworkTable.Observation obs)
Specified by ostore.oil.Model interface |
protected void |
record(PatchworkTable.Observation[] observations)
Specified by ostore.oil.Model interface |
protected void |
remove(NodeId peer)
Tells the model to remove all statistics for this peer at the time of the next recalculation. |
void |
serialize(OutputBuffer buffer)
Specified by ostore.util.QuickSerializable |
protected void |
setAlpha(double newAlpha)
|
protected void |
setThreshold(double newThresh)
|
String |
toString()
Returns a string representation of the object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PatchworkTable()
PatchworkTable
.public PatchworkTable(InputBuffer buffer) throws QSException
Method Detail |
protected void record(PatchworkTable.Observation[] observations)
protected void record(PatchworkTable.Observation obs)
public PatchworkStats getStats(NodeId peer, byte type)
peer
- the node you're interested intype
- the type of statistic desired (see class description
for valid types.protected boolean initStat(NodeId peer, byte type, long value)
protected void remove(NodeId peer)
peer
- the node for which to remove the statisticspublic void add_delta(PatchworkTable.Delta d)
protected PatchworkTable.Delta recalculate()
protected double getAlpha()
protected double getThreshold()
protected void setAlpha(double newAlpha)
protected void setThreshold(double newThresh)
public void serialize(OutputBuffer buffer)
serialize
in interface QuickSerializable
ostore.util.QuickSerializable
buffer
- the output buffer to add the object topublic String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |