com.limegroup.gnutella.routing
Class StatisticsRecorder

java.lang.Object
  extended bycom.limegroup.gnutella.routing.StatisticsRecorder

public class StatisticsRecorder
extends java.lang.Object

A class used to gather statistics for an alpha test and send the statistics periodically to a server for further analysis. To add a statistic for sending to the server, just use the static method addToAverage, passing in the statistic and value.


Constructor Summary
StatisticsRecorder()
           
 
Method Summary
static void addToAverage(java.lang.String name, int value, java.lang.String metricUnit)
          Adds the value to the statistic (specified by name).
static void addToPercentage(java.lang.String name, int totalValue, int percentValue)
          Adds the values to the percent statistic (specified by name).
static void addToTotal(java.lang.String name, int value, java.lang.String metricUnit)
          Adds the value to the statistic (specified by name).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatisticsRecorder

public StatisticsRecorder()
Method Detail

addToAverage

public static void addToAverage(java.lang.String name,
                                int value,
                                java.lang.String metricUnit)
Adds the value to the statistic (specified by name). If the statistic doesn't exist, creates a new mapping for the new statistic.

Parameters:
name - the name of the statistic.

addToTotal

public static void addToTotal(java.lang.String name,
                              int value,
                              java.lang.String metricUnit)
Adds the value to the statistic (specified by name). If the statistic doesn't exist, creates a new mapping for the new statistic.

Parameters:
name - the name of the statistic.

addToPercentage

public static void addToPercentage(java.lang.String name,
                                   int totalValue,
                                   int percentValue)
Adds the values to the percent statistic (specified by name). If the statistic doesn't exist, creates a mapping for the new statistic.

Parameters:
totalValue - the denominator (total) of the percentage.
percentValue - the numerator (part or subtotal) of the percentage.