Page Speed Optimization Libraries
1.3.25.1
|
Base class for implementations of monitoring statistics. More...
#include "statistics.h"
Public Member Functions | |
virtual Variable * | AddVariable (const StringPiece &name)=0 |
virtual Variable * | AddGlobalVariable (const StringPiece &name) |
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 | DumpConsoleVarsToWriter (int64 current_time_ms, Writer *writer, MessageHandler *message_handler) |
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 ConsoleStatisticsLogger * | console_logger () const |
Protected Member Functions | |
FakeTimedVariable * | NewFakeTimedVariable (const StringPiece &name, int index) |
A helper for subclasses that do not fully implement timed variables. |
Base class for implementations of monitoring statistics.
virtual Variable* net_instaweb::Statistics::AddGlobalVariable | ( | const StringPiece & | name | ) | [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, Hist, TimedVar >, net_instaweb::StatisticsTemplate< NullStatisticsVariable, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SimpleStatsVariable, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SharedMemVariable, SharedMemHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SplitVariable, SplitHistogram, SplitTimedVariable >, and net_instaweb::StatisticsTemplate< Var, CountHistogram, FakeTimedVariable >.
virtual Histogram* net_instaweb::Statistics::AddHistogram | ( | const StringPiece & | name | ) | [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, Hist, TimedVar >, net_instaweb::StatisticsTemplate< NullStatisticsVariable, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SimpleStatsVariable, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SharedMemVariable, SharedMemHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SplitVariable, SplitHistogram, SplitTimedVariable >, and net_instaweb::StatisticsTemplate< Var, CountHistogram, FakeTimedVariable >.
virtual TimedVariable* net_instaweb::Statistics::AddTimedVariable | ( | const StringPiece & | name, |
const StringPiece & | group | ||
) | [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, Hist, TimedVar >, net_instaweb::StatisticsTemplate< NullStatisticsVariable, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SimpleStatsVariable, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SharedMemVariable, SharedMemHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SplitVariable, SplitHistogram, SplitTimedVariable >, and net_instaweb::StatisticsTemplate< Var, CountHistogram, FakeTimedVariable >.
virtual Variable* net_instaweb::Statistics::AddVariable | ( | const StringPiece & | name | ) | [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, Hist, TimedVar >, net_instaweb::StatisticsTemplate< NullStatisticsVariable, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SimpleStatsVariable, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SharedMemVariable, SharedMemHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SplitVariable, SplitHistogram, SplitTimedVariable >, and net_instaweb::StatisticsTemplate< Var, CountHistogram, FakeTimedVariable >.
virtual void net_instaweb::Statistics::Clear | ( | ) | [pure virtual] |
Set all variables to 0. Throw away all data in histograms and stats.
Implemented in net_instaweb::StatisticsTemplate< Var, Hist, TimedVar >, net_instaweb::StatisticsTemplate< NullStatisticsVariable, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SimpleStatsVariable, CountHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SharedMemVariable, SharedMemHistogram, FakeTimedVariable >, net_instaweb::StatisticsTemplate< SplitVariable, SplitHistogram, SplitTimedVariable >, and net_instaweb::StatisticsTemplate< Var, CountHistogram, FakeTimedVariable >.
virtual ConsoleStatisticsLogger* net_instaweb::Statistics::console_logger | ( | ) | const [inline, virtual] |
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 ConsoleStatisticsLogger associated with this Statistics.
Reimplemented in net_instaweb::SharedMemStatistics.
virtual void net_instaweb::Statistics::DumpConsoleVarsToWriter | ( | int64 | current_time_ms, |
Writer * | writer, | ||
MessageHandler * | message_handler | ||
) | [inline, virtual] |
Export statistics to a writer. Statistics in a group are exported in one table. This only exports console-related variables, as opposed to all variables, as the above does. Empty implementation because most Statistics don't need this. It's here because in the context in which it is needed we only have access to a Statistics*, rather than the specific subclass. current_time_ms: the time at which the dump was triggered
Reimplemented in net_instaweb::SharedMemStatistics.