OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Protected Member Functions | List of all members
OpenSim.Framework.MetricsCollector< T > Class Template Referenceabstract

Collects metrics in a sliding window. More...

Inheritance diagram for OpenSim.Framework.MetricsCollector< T >:
Inheritance graph
[legend]

Public Member Functions

 MetricsCollector (int windowSize, int numBuckets)
 Creates a MetricsCollector. More...
 
void Reset ()
 
void AddSample (T sample)
 
GetSum ()
 Returns the total values in the collection window. More...
 

Protected Member Functions

abstract T GetZero ()
 Returns the default (zero) value. More...
 
abstract T Add (T a, T b)
 Adds two values. More...
 

Detailed Description

Collects metrics in a sliding window.

MetricsCollector provides the current Sum of the metrics that it collects. It can easily be extended to provide the Average, too. It uses a sliding window to keep these values current.

This class is not thread-safe.

Subclass MetricsCollector to have it use a concrete value type. Override the abstract methods.

Definition at line 64 of file MetricsCollector.cs.

Constructor & Destructor Documentation

OpenSim.Framework.MetricsCollector< T >.MetricsCollector ( int  windowSize,
int  numBuckets 
)
inline

Creates a MetricsCollector.

Parameters
windowSizeThe period of time over which to collect the metrics, in ms. E.g.: 30,000.
numBucketsThe number of buckets to divide the samples into. E.g.: 10. Using more buckets smooths the jarring that occurs whenever we drop an old bucket, but uses more memory.

Definition at line 99 of file MetricsCollector.cs.

Member Function Documentation

abstract T OpenSim.Framework.MetricsCollector< T >.Add ( a,
b 
)
protectedpure virtual

Adds two values.

void OpenSim.Framework.MetricsCollector< T >.AddSample ( sample)
inline

Definition at line 114 of file MetricsCollector.cs.

T OpenSim.Framework.MetricsCollector< T >.GetSum ( )
inline

Returns the total values in the collection window.

Definition at line 129 of file MetricsCollector.cs.

abstract T OpenSim.Framework.MetricsCollector< T >.GetZero ( )
protectedpure virtual

Returns the default (zero) value.

Returns

Implemented in OpenSim.Framework.MetricsCollectorLong.

void OpenSim.Framework.MetricsCollector< T >.Reset ( )
inline

Definition at line 106 of file MetricsCollector.cs.


The documentation for this class was generated from the following file: