org.jgroups.protocols

Class PERF


public class PERF
extends Protocol

Measures time taken by each protocol to process a message. PERF has to be the top protocol in a stack. It adds a special header to the message which travels with the message. Upon initialization, PERF creates a ProtocolObserver for each protocol layer in the stack. That observer notes the time taken for a message to travel through the layer it observes, and records the start time, end time and total time in the message itself (in the header created by PERF). When a message is received by PERF, the statistics for the message are appended to a file (or displayed in a GUI (not yet done)).

Because of different wall times between different machines, PERF should only be used for members in the same JVM. For members in different processes, physical clocks have to be synchronized: if they are only a few milliseconds aprt, the values will be incorrect. For example, to write all performance data to a file, do the following:

  1. Set tracing to on, e.g. trace=true in jgroups.properties
  2. Add a trace statement for PERF.up(): trace0=PERF.up DEBUG /tmp/trace.perf. This will write all trace output to the given file.
Version:
$Revision: 1.10 $
Author:
Bela Ban Oct 2001

Field Summary

Fields inherited from class org.jgroups.stack.Protocol

down_handler, down_prot, down_queue, down_thread, down_thread_prio, log, observer, props, stack, stats, trace, up_handler, up_prot, up_queue, up_thread, up_thread_prio, warn

Method Summary

void
down(Event evt)
String
getName()
All protocol names have to be unique !
boolean
setProperties(Properties props)
void
start()
void
up(Event evt)

Methods inherited from class org.jgroups.stack.Protocol

destroy, down, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getDownQueue, getName, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, init, isTrace, isWarn, passDown, passUp, printStats, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setObserver, setProperties, setPropertiesInternal, setProtocolStack, setTrace, setUpProtocol, setWarn, start, startDownHandler, startUpHandler, statsEnabled, stop, stopInternal, up, upThreadEnabled

Method Details

down

public void down(Event evt)
Overrides:
down in interface Protocol

getName

public String getName()
All protocol names have to be unique !
Overrides:
getName in interface Protocol

setProperties

public boolean setProperties(Properties props)
Overrides:
setProperties in interface Protocol

start

public void start()
            throws Exception
Overrides:
start in interface Protocol

up

public void up(Event evt)
Overrides:
up in interface Protocol

Copyright B) 1998-2005 Bela Ban. All Rights Reserved.