#include "statistics_template.h"
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 GoogleString & | histogram_names (size_t pos) const |
This class makes it easier to define new Statistics implementations by providing a templatized implementation of variable registration and management.
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.
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.
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.
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.