Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | List of all members
net_instaweb::StatisticsTemplate< Var, UpDown, Hist, TimedVar > Class Template Referenceabstract

#include "statistics_template.h"

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

Public Member Functions

virtual Var * AddVariable (const StringPiece &name)
 
virtual UpDown * AddUpDownCounter (const StringPiece &name)
 
virtual UpDown * AddGlobalUpDownCounter (const StringPiece &name)
 
virtual Var * FindVariable (const StringPiece &name) const
 Find a variable from a name, returning NULL if not found.
 
virtual UpDown * FindUpDownCounter (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 DumpJson (Writer *writer, MessageHandler *message_handler)
 
virtual void Clear ()
 
- Public Member Functions inherited from net_instaweb::Statistics
UpDownCounterGetUpDownCounter (const StringPiece &name) const
 Find a variable from a name, aborting if not found.
 
VariableGetVariable (const StringPiece &name) const
 Find a variable from a name, aborting if not found.
 
HistogramGetHistogram (const StringPiece &name) const
 Find a histogram from a name, aborting if not found.
 
TimedVariableGetTimedVariable (const StringPiece &name) const
 Find a TimedVariable from a name, aborting if not found.
 
virtual void RenderTimedVariables (Writer *writer, MessageHandler *handler)
 
virtual void RenderHistograms (Writer *writer, MessageHandler *handler)
 Write all the histograms in this Statistic object to a writer.
 
virtual StatisticsLoggerconsole_logger ()
 
int64 LookupValue (StringPiece stat_name)
 

Protected Member Functions

virtual Var * NewVariable (StringPiece name)=0
 Interface to subclass.
 
virtual UpDown * NewUpDownCounter (StringPiece name)=0
 Interface to subclass.
 
virtual UpDown * NewGlobalUpDownCounter (StringPiece name)
 Default implementation just calls NewUpDownCounter.
 
virtual Hist * NewHistogram (StringPiece name)=0
 
virtual TimedVar * NewTimedVariable (StringPiece name)=0
 
size_t variables_size () const
 
Var * variables (size_t pos)
 
size_t up_down_size () const
 
UpDown * up_downs (size_t pos)
 
size_t histograms_size () const
 
Hist * histograms (size_t pos)
 
const GoogleStringhistogram_names (size_t pos) const
 

Additional Inherited Members

- Static Public Attributes inherited from net_instaweb::Statistics
static const char kDefaultGroup []
 Default group for use with AddTimedVariable.
 

Detailed Description

template<class Var, class UpDown, class Hist, class TimedVar>
class net_instaweb::StatisticsTemplate< Var, UpDown, 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 UpDown, class Hist, class TimedVar>
virtual UpDown* net_instaweb::StatisticsTemplate< Var, UpDown, Hist, TimedVar >::AddGlobalUpDownCounter ( const StringPiece &  name)
inlinevirtual

Like AddVariable, but asks the implementation to scope the variable to the entire process, even if statistics are generally partitioned by domains or the like. Default implementation simply forwards to AddVariable.

Reimplemented from net_instaweb::Statistics.

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

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 UpDown, class Hist, class TimedVar>
virtual TimedVar* net_instaweb::StatisticsTemplate< Var, UpDown, Hist, TimedVar >::AddTimedVariable ( const StringPiece &  name,
const StringPiece &  group 
)
inlinevirtual

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 UpDown, class Hist, class TimedVar>
virtual UpDown* net_instaweb::StatisticsTemplate< Var, UpDown, Hist, TimedVar >::AddUpDownCounter ( const StringPiece &  name)
inlinevirtual

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

Implements net_instaweb::Statistics.

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

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

Implements net_instaweb::Statistics.

template<class Var, class UpDown, class Hist, class TimedVar>
virtual void net_instaweb::StatisticsTemplate< Var, UpDown, Hist, TimedVar >::Clear ( )
inlinevirtual

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

Implements net_instaweb::Statistics.

template<class Var, class UpDown, class Hist, class TimedVar>
virtual void net_instaweb::StatisticsTemplate< Var, UpDown, Hist, TimedVar >::DumpJson ( Writer writer,
MessageHandler message_handler 
)
inlinevirtual

The string written to the writer will be like this: {"variables": {"cache_hits": 10,"cache_misses": 5,...}, "maxlength": 50}

Implements net_instaweb::Statistics.


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