tapestry.patchwork
Class Patchwork
java.lang.Object
|
+--tapestry.patchwork.Patchwork
- All Implemented Interfaces:
- EventHandlerIF, SingleThreadedEventHandlerIF
- public class Patchwork
- extends Object
- implements EventHandlerIF, SingleThreadedEventHandlerIF
Stage that measures other nodes on a regular basis, for a variety of
specifiable conditions. Is able to measure anything that can be written as
an extension to the Patch
class.
Is capable of monitoring nodes on a short-term or long-term basis (see
QuickStatReq
and MonitorMsg
respectively).
The config file can contain the following options:
numPatches
: The number of patches to be specified in the
config file for this stage. If this is N, then Patch0
through PatchN-1 must be specified. They can be in any order.
PatchX
: A specification for a type of measurement
module. This is expected to be in the following form:
PatchX patch_name [base_period] [op] [factor]
Where patch_name
can be "loss", "latency", "bandwidth",
or "recalc". The other fields are increasingly optional; they specify
the periodic function by which nodes are probed. base_period
is the base probing time in ms (default: 1 second) , op
is
the operation (can be "add"/"+", "mult"/"*", "sub"/"-", "div"/"/", or
"exp"/"^") (default: "+"), and factor
is the amount by which
the base period is altered for each probing level (default: 0).
For example, if "1000 * 2" is specified, then
nodes at probing level 0 get probed every 1 second, level 1 at 2 seconds,
level 2 at 4 seconds, level 3 at 8 seconds, etc. The probing level
of a node is specified when a MonitorMsg
is sent to Patchwork,
either with an explicit level, or an initial measurement value that can
determine the type.
timeout
: Milliseconds after which a probe is considered lost.
Default is 10 seconds.
lossRespondEvery
: When monitoring loss rate, how often should
a receiver of probes respond. Specified in number of probes. The default
is 5 (meaning the receiver responds every five packets).
If another stage wishes to keep track of the long-term statistics, it should
create a PatchworkTable when it initializes, then apply deltas
to it every time a DeltaMsg
is sent out.
- Version:
- $Id: Patchwork.java,v 1.1.1.1 2004/03/26 19:57:10 hweather Exp $
- Author:
- Jeremy Stribling
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MESSAGE_SIZE
protected static final int MESSAGE_SIZE
- See Also:
- Constant Field Values
Patchwork
public Patchwork()
handleEvents
public void handleEvents(QueueElementIF[] elemarr)
throws EventHandlerException
- Specified by seda.sandStorm.api.EventHandlerIF
- Specified by:
handleEvents
in interface EventHandlerIF
EventHandlerException
handleEvent
public void handleEvent(QueueElementIF element)
throws EventHandlerException
- Specified by seda.sandStorm.api.EventHandlerIF
- Specified by:
handleEvent
in interface EventHandlerIF
EventHandlerException
init
public void init(ConfigDataIF config)
throws Exception
- Specified by seda.sandStorm.api.EventHandlerIF
- Specified by:
init
in interface EventHandlerIF
Exception
dispatch
protected void dispatch(QueueElementIF event)
- An internal method used for dispatching events
destroy
public void destroy()
- Specified by seda.sandStorm.api.EventHandlerIF
- Specified by:
destroy
in interface EventHandlerIF