org.jboss.web.tomcat.statistics
Class InvocationStatistics

java.lang.Object
  extended byorg.jboss.web.tomcat.statistics.InvocationStatistics
All Implemented Interfaces:
java.io.Serializable

public class InvocationStatistics
extends java.lang.Object
implements java.io.Serializable

A web context invocation statistics collection class.

See Also:
Serialized Form

Nested Class Summary
static class InvocationStatistics.TimeStatistic (src)
           
 
Field Summary
 int concurrentCalls
          The number of concurrent request across all contexts
 long lastResetTime
          Time of the last resetStats call
 int maxConcurrentCalls
          The maximum number of concurrent request across all contexts
 
Constructor Summary
InvocationStatistics()
           
 
Method Summary
 void callIn()
           
 void callOut()
           
 java.util.Map getStats()
          Access the current collection of ctx invocation statistics
 void resetStats()
          Resets all current TimeStatistics.
 java.lang.String toString()
           
 java.lang.String toXML()
          Generate an XML fragement for the InvocationStatistics.
 void updateStats(java.lang.String ctx, long elapsed)
          Update the TimeStatistic for the given ctx.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

concurrentCalls

public volatile int concurrentCalls
The number of concurrent request across all contexts


maxConcurrentCalls

public volatile int maxConcurrentCalls
The maximum number of concurrent request across all contexts


lastResetTime

public long lastResetTime
Time of the last resetStats call

Constructor Detail

InvocationStatistics

public InvocationStatistics()
Method Detail

updateStats

public void updateStats(java.lang.String ctx,
                        long elapsed)
Update the TimeStatistic for the given ctx. This does not synchronize on the TimeStatistic so the results are an approximate values.

Parameters:
ctx - the method to update the statistics for.
elapsed - the elapsed time in milliseconds for the invocation.

callIn

public void callIn()

callOut

public void callOut()

resetStats

public void resetStats()
Resets all current TimeStatistics.


getStats

public java.util.Map getStats()
Access the current collection of ctx invocation statistics

Returns:
A HashMap of the ctx invocations

toString

public java.lang.String toString()

toXML

public java.lang.String toXML()
Generate an XML fragement for the InvocationStatistics. The format is ...

Returns:
an XML representation of the InvocationStatistics