Page Speed Optimization Libraries
1.13.35.1
|
Base class for implementations of monitoring statistics. More...
#include "statistics.h"
Public Member Functions | |
virtual UpDownCounter * | AddUpDownCounter (const StringPiece &name)=0 |
virtual UpDownCounter * | AddGlobalUpDownCounter (const StringPiece &name) |
virtual UpDownCounter * | FindUpDownCounter (const StringPiece &name) const =0 |
Find a variable from a name, returning NULL if not found. | |
UpDownCounter * | GetUpDownCounter (const StringPiece &name) const |
Find a variable from a name, aborting if not found. | |
virtual Variable * | AddVariable (const StringPiece &name)=0 |
virtual Variable * | FindVariable (const StringPiece &name) const =0 |
Find a variable from a name, returning NULL if not found. | |
Variable * | GetVariable (const StringPiece &name) const |
Find a variable from a name, aborting if not found. | |
virtual Histogram * | AddHistogram (const StringPiece &name)=0 |
virtual Histogram * | FindHistogram (const StringPiece &name) const =0 |
Find a histogram from a name, returning NULL if not found. | |
Histogram * | GetHistogram (const StringPiece &name) const |
Find a histogram from a name, aborting if not found. | |
virtual TimedVariable * | AddTimedVariable (const StringPiece &name, const StringPiece &group)=0 |
virtual TimedVariable * | FindTimedVariable (const StringPiece &name) const =0 |
Find a TimedVariable from a name, returning NULL if not found. | |
TimedVariable * | GetTimedVariable (const StringPiece &name) const |
Find a TimedVariable from a name, aborting if not found. | |
virtual const StringVector & | HistogramNames ()=0 |
Return the names of all the histograms for render. | |
virtual const std::map < GoogleString, StringVector > & | TimedVariableMap ()=0 |
Return the map of groupnames and names of all timedvariables for render. | |
virtual void | Dump (Writer *writer, MessageHandler *handler)=0 |
Dump the variable-values to a writer. | |
virtual void | DumpJson (Writer *writer, MessageHandler *message_handler)=0 |
Dump the variable-values in JSON format to a writer. | |
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 void | Clear ()=0 |
virtual StatisticsLogger * | console_logger () |
int64 | LookupValue (StringPiece stat_name) |
Static Public Attributes | |
static const char | kDefaultGroup [] |
Default group for use with AddTimedVariable. | |
Base class for implementations of monitoring statistics.
|
virtual |
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 in net_instaweb::StatisticsTemplate< Var, UpDown, Hist, TimedVar >, net_instaweb::StatisticsTemplate< VarTemplate< SharedMemVariable >, UpDownTemplate< SharedMemVariable >, SharedMemHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< VarTemplate< Impl >, UpDownTemplate< Impl >, HistC, TVarC >, net_instaweb::StatisticsTemplate< VarTemplate< NullStatisticsVariable >, UpDownTemplate< NullStatisticsVariable >, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SplitVariable, SplitUpDownCounter, SplitHistogram, SplitTimedVariable >, and net_instaweb::StatisticsTemplate< VarTemplate< SimpleStatsVariable >, UpDownTemplate< SimpleStatsVariable >, CountHistogram, FakeTimedVariable >.
|
pure 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.
Implemented in net_instaweb::StatisticsTemplate< Var, UpDown, Hist, TimedVar >, net_instaweb::StatisticsTemplate< VarTemplate< SharedMemVariable >, UpDownTemplate< SharedMemVariable >, SharedMemHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< VarTemplate< Impl >, UpDownTemplate< Impl >, HistC, TVarC >, net_instaweb::StatisticsTemplate< VarTemplate< NullStatisticsVariable >, UpDownTemplate< NullStatisticsVariable >, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SplitVariable, SplitUpDownCounter, SplitHistogram, SplitTimedVariable >, and net_instaweb::StatisticsTemplate< VarTemplate< SimpleStatsVariable >, UpDownTemplate< SimpleStatsVariable >, CountHistogram, FakeTimedVariable >.
|
pure 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.
Implemented in net_instaweb::StatisticsTemplate< Var, UpDown, Hist, TimedVar >, net_instaweb::StatisticsTemplate< VarTemplate< SharedMemVariable >, UpDownTemplate< SharedMemVariable >, SharedMemHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< VarTemplate< Impl >, UpDownTemplate< Impl >, HistC, TVarC >, net_instaweb::StatisticsTemplate< VarTemplate< NullStatisticsVariable >, UpDownTemplate< NullStatisticsVariable >, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SplitVariable, SplitUpDownCounter, SplitHistogram, SplitTimedVariable >, and net_instaweb::StatisticsTemplate< VarTemplate< SimpleStatsVariable >, UpDownTemplate< SimpleStatsVariable >, CountHistogram, FakeTimedVariable >.
|
pure virtual |
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.
Implemented in net_instaweb::StatisticsTemplate< Var, UpDown, Hist, TimedVar >, net_instaweb::StatisticsTemplate< VarTemplate< SharedMemVariable >, UpDownTemplate< SharedMemVariable >, SharedMemHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< VarTemplate< Impl >, UpDownTemplate< Impl >, HistC, TVarC >, net_instaweb::StatisticsTemplate< VarTemplate< NullStatisticsVariable >, UpDownTemplate< NullStatisticsVariable >, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SplitVariable, SplitUpDownCounter, SplitHistogram, SplitTimedVariable >, and net_instaweb::StatisticsTemplate< VarTemplate< SimpleStatsVariable >, UpDownTemplate< SimpleStatsVariable >, CountHistogram, FakeTimedVariable >.
|
pure virtual |
Add a new variable, or returns an existing one of that name. The Variable* is owned by the Statistics class – it should not be deleted by the caller.
Implemented in net_instaweb::StatisticsTemplate< Var, UpDown, Hist, TimedVar >, net_instaweb::StatisticsTemplate< VarTemplate< SharedMemVariable >, UpDownTemplate< SharedMemVariable >, SharedMemHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< VarTemplate< Impl >, UpDownTemplate< Impl >, HistC, TVarC >, net_instaweb::StatisticsTemplate< VarTemplate< NullStatisticsVariable >, UpDownTemplate< NullStatisticsVariable >, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SplitVariable, SplitUpDownCounter, SplitHistogram, SplitTimedVariable >, and net_instaweb::StatisticsTemplate< VarTemplate< SimpleStatsVariable >, UpDownTemplate< SimpleStatsVariable >, CountHistogram, FakeTimedVariable >.
|
pure virtual |
Set all variables to 0. Throw away all data in histograms and stats.
Implemented in net_instaweb::StatisticsTemplate< Var, UpDown, Hist, TimedVar >, net_instaweb::StatisticsTemplate< VarTemplate< SharedMemVariable >, UpDownTemplate< SharedMemVariable >, SharedMemHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< VarTemplate< Impl >, UpDownTemplate< Impl >, HistC, TVarC >, net_instaweb::StatisticsTemplate< VarTemplate< NullStatisticsVariable >, UpDownTemplate< NullStatisticsVariable >, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SplitVariable, SplitUpDownCounter, SplitHistogram, SplitTimedVariable >, and net_instaweb::StatisticsTemplate< VarTemplate< SimpleStatsVariable >, UpDownTemplate< SimpleStatsVariable >, CountHistogram, FakeTimedVariable >.
|
inlinevirtual |
This is implemented as NULL here because most Statistics don't need it. In the context in which it is needed we only have access to a Statistics*, rather than the specific subclass, hence its being here. Return the StatisticsLogger associated with this Statistics.
Reimplemented in net_instaweb::SharedMemStatistics, and net_instaweb::SplitStatistics.
int64 net_instaweb::Statistics::LookupValue | ( | StringPiece | stat_name | ) |
Testing helper method to look up a statistics numeric value by name. Please do not use this in production code. This finds the current value whether it is stored in a Variable, UpDownCounter, or TimedVariable.
If the statistics is not found, the program check-fails.