net_instaweb::StatisticsTemplate< Var, Hist, TimedVar > Class Template Reference

#include "statistics_template.h"

Inheritance diagram for net_instaweb::StatisticsTemplate< Var, Hist, TimedVar >:
net_instaweb::Statistics

List of all members.

Public Member Functions

virtual Var * AddVariable (const StringPiece &name)
virtual Var * FindVariable (const StringPiece &name) const
 Find a variable from a name, returning NULL if not found.
virtual Hist * AddHistogram (const StringPiece &name)
virtual Hist * FindHistogram (const StringPiece &name) const
 Find a histogram from a name, returning NULL if not found.
virtual TimedVar * AddTimedVariable (const StringPiece &name, const StringPiece &group)
virtual TimedVar * FindTimedVariable (const StringPiece &name) const
 Find a TimedVariable from a name, returning NULL if not found.
virtual const StringVector & HistogramNames ()
 Return the names of all the histograms for render.
virtual const std::map
< GoogleString, StringVector > & 
TimedVariableMap ()
 Return the map of groupnames and names of all timedvariables for render.
virtual void Dump (Writer *writer, MessageHandler *message_handler)
 Dump the variable-values to a writer.
virtual void Clear ()

Protected Member Functions

virtual Var * NewVariable (const StringPiece &name, int index)=0
 Interface to subclass.
virtual Hist * NewHistogram (const StringPiece &name)=0
virtual TimedVar * NewTimedVariable (const StringPiece &name, int index)=0
size_t variables_size () const
Var * variables (size_t pos)
size_t histograms_size () const
Hist * histograms (size_t pos)
const GoogleStringhistogram_names (size_t pos) const

Detailed Description

template<class Var, class Hist, class TimedVar>
class net_instaweb::StatisticsTemplate< Var, Hist, TimedVar >

This class makes it easier to define new Statistics implementations by providing a templatized implementation of variable registration and management.


Member Function Documentation

template<class Var, class Hist, class TimedVar>
virtual Hist* net_instaweb::StatisticsTemplate< Var, Hist, TimedVar >::AddHistogram ( const StringPiece &  name  )  [inline, virtual]

Add a new histogram, or returns an existing one of that name. The Histogram* is owned by the Statistics class -- it should not be deleted by the caller.

Implements net_instaweb::Statistics.

template<class Var, class Hist, class TimedVar>
virtual TimedVar* net_instaweb::StatisticsTemplate< Var, Hist, TimedVar >::AddTimedVariable ( const StringPiece &  name,
const StringPiece &  group 
) [inline, virtual]

Add a new TimedVariable, or returns an existing one of that name. The TimedVariable* is owned by the Statistics class -- it should not be deleted by the caller. Each stat belongs to a group, such as "Statistics", "Disk Statistics", etc.

Implements net_instaweb::Statistics.

template<class Var, class Hist, class TimedVar>
virtual Var* net_instaweb::StatisticsTemplate< Var, Hist, TimedVar >::AddVariable ( const StringPiece &  name  )  [inline, virtual]

Implementations of Statistics API --- see base class docs for description.

Implements net_instaweb::Statistics.

template<class Var, class Hist, class TimedVar>
virtual void net_instaweb::StatisticsTemplate< Var, Hist, TimedVar >::Clear (  )  [inline, virtual]

Set all variables to 0. Throw away all data in histograms and stats.

Implements net_instaweb::Statistics.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Tue May 29 16:34:19 2012 for Page Speed Optimization Libraries by  doxygen 1.6.3