bcds.phison.sim
Class PmTraceProgress<V,E>

java.lang.Object
  extended by bcds.phison.sim.PmBase<V,E>
      extended by bcds.phison.sim.PmTraceProgress<V,E>
All Implemented Interfaces:
ProcessingModule<V,E>, WithEnvParams

public class PmTraceProgress<V,E>
extends PmBase<V,E>

The module PmTraceProgress prints information about connections acceptance and rejection at regular intervals of connection requests. Specifically, the following is printed:

The interval is controlled by the "interval" environment parameter.

An example of the output produced by this module is (the interval is 5):

 ...
 # received=20 blocked=0 (0.00000) active=20 curtime=5
 # received=25 blocked=1 (0.04000) active=23 curtime=6
 # received=30 blocked=2 (0.06667) active=26 curtime=8
 # received=35 blocked=4 (0.11429) active=28 curtime=9
 ...
 

Author:
Juan Segovia S.

Constructor Summary
PmTraceProgress()
           
 
Method Summary
 java.lang.Object[] getEnvParams()
          Returns the environment parameters of this class; the prefix is "PmTraceProgress..
 void run(SimEvents evtype, ConnectionInfo<V,E> rq)
          Keeps a count of the number of connections accepted and rejected.
 
Methods inherited from class bcds.phison.sim.PmBase
ctx, env, getEnviron, getId, getName, opt, setup, shutdown, sim, stats
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PmTraceProgress

public PmTraceProgress()
Method Detail

run

public void run(SimEvents evtype,
                ConnectionInfo<V,E> rq)
Keeps a count of the number of connections accepted and rejected. It prints the values obtained from the above counters if the current event is the k-th connection request from the last print, where k=interval.

This method counts the number of received connections by itself and does not rely on sim().conn_received on purpose: the events passed to this module might be "filtered" (not all traffic is being exposed to all modules, as happens when PmDTypeReplicator is used).

This module does not cache the values of the environment parameters; they are re-evaluated each time they are needed.

Specified by:
run in interface ProcessingModule<V,E>
Overrides:
run in class PmBase<V,E>

getEnvParams

public java.lang.Object[] getEnvParams()
Returns the environment parameters of this class; the prefix is "PmTraceProgress..

Specified by:
getEnvParams in interface WithEnvParams
Overrides:
getEnvParams in class PmBase<V,E>