net.sf.sensor.counter
Class CounterRuntime

java.lang.Object
  extended bynet.sf.sensor.counter.CounterRuntime

public class CounterRuntime
extends Object

Main entry point for working with Counters. Counters usually keep track of a countable piece of business information, like the numbers of orders processed, the number of active sessions, the number of logged in users, etc.

Author:
Age Mooy

Constructor Summary
CounterRuntime()
           
 
Method Summary
 Counter getCounter(String label)
          Retrieves the Counter that matches the specified label.
 List getCounters()
          Returns a List<Counter> of all active counters.
 void reset()
          Resets all active counters to zero.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CounterRuntime

public CounterRuntime()
Method Detail

getCounter

public Counter getCounter(String label)
Retrieves the Counter that matches the specified label.

Parameters:
label - the label that should match an active instance of Counter.
Returns:
the Counter that matches the specified label.

getCounters

public List getCounters()
Returns a List<Counter> of all active counters. The list will be in semi-random order since the counters are internally stored in a Map and the List is created on demand.

Returns:
a List<Counter> of all registered gauges. todo: add a bit of optimization to prevent new lists being created all the time.

reset

public void reset()
Resets all active counters to zero. This method does not delete any counters.



Copyright © 2005-2006 SourceForge. All Rights Reserved.