Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
net_instaweb::SharedMemStatistics Class Reference
Inheritance diagram for net_instaweb::SharedMemStatistics:
net_instaweb::ScalarStatisticsTemplate< SharedMemVariable, SharedMemHistogram, FakeTimedVariable > net_instaweb::StatisticsTemplate< VarTemplate< SharedMemVariable >, UpDownTemplate< SharedMemVariable >, SharedMemHistogram, FakeTimedVariable > net_instaweb::Statistics

Public Member Functions

 SharedMemStatistics (int64 logging_interval_ms, int64 max_logfile_size_kb, const StringPiece &logging_file, bool logging, const GoogleString &filename_prefix, AbstractSharedMem *shm_runtime, MessageHandler *message_handler, FileSystem *file_system, Timer *timer)
 
bool Init (bool parent, MessageHandler *message_handler)
 
void GlobalCleanup (MessageHandler *message_handler)
 
GoogleString SegmentName () const
 
virtual StatisticsLoggerconsole_logger ()
 
- Public Member Functions inherited from net_instaweb::StatisticsTemplate< VarTemplate< SharedMemVariable >, UpDownTemplate< SharedMemVariable >, SharedMemHistogram, FakeTimedVariable >
virtual VarTemplate
< SharedMemVariable > * 
AddVariable (const StringPiece &name)
 
virtual UpDownTemplate
< SharedMemVariable > * 
AddUpDownCounter (const StringPiece &name)
 
virtual UpDownTemplate
< SharedMemVariable > * 
AddGlobalUpDownCounter (const StringPiece &name)
 
virtual VarTemplate
< SharedMemVariable > * 
FindVariable (const StringPiece &name) const
 Find a variable from a name, returning NULL if not found.
 
virtual UpDownTemplate
< SharedMemVariable > * 
FindUpDownCounter (const StringPiece &name) const
 Find a variable from a name, returning NULL if not found.
 
virtual SharedMemHistogramAddHistogram (const StringPiece &name)
 
virtual SharedMemHistogramFindHistogram (const StringPiece &name) const
 Find a histogram from a name, returning NULL if not found.
 
virtual FakeTimedVariableAddTimedVariable (const StringPiece &name, const StringPiece &group)
 
virtual FakeTimedVariableFindTimedVariable (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.
 
int64 LookupValue (StringPiece stat_name)
 

Static Public Member Functions

static void GlobalCleanup (AbstractSharedMem *shm_runtime, const GoogleString &segment_name, MessageHandler *message_handler)
 

Protected Member Functions

virtual VarNewVariable (StringPiece name)
 Interface to subclass.
 
virtual UpDownNewUpDownCounter (StringPiece name)
 Interface to subclass.
 
virtual HistNewHistogram (StringPiece name)
 
- Protected Member Functions inherited from net_instaweb::ScalarStatisticsTemplate< SharedMemVariable, SharedMemHistogram, FakeTimedVariable >
virtual TVarNewTimedVariable (StringPiece name)
 
- Protected Member Functions inherited from net_instaweb::StatisticsTemplate< VarTemplate< SharedMemVariable >, UpDownTemplate< SharedMemVariable >, SharedMemHistogram, FakeTimedVariable >
virtual UpDownTemplate
< SharedMemVariable > * 
NewGlobalUpDownCounter (StringPiece name)
 Default implementation just calls NewUpDownCounter.
 
size_t variables_size () const
 
VarTemplate< SharedMemVariable > * variables (size_t pos)
 
size_t up_down_size () const
 
UpDownTemplate
< SharedMemVariable > * 
up_downs (size_t pos)
 
size_t histograms_size () const
 
SharedMemHistogramhistograms (size_t pos)
 
const GoogleStringhistogram_names (size_t pos) const
 

Friends

class SharedMemStatisticsTestBase
 

Additional Inherited Members

- Public Types inherited from net_instaweb::ScalarStatisticsTemplate< SharedMemVariable, SharedMemHistogram, FakeTimedVariable >
typedef VarTemplate
< SharedMemVariable
Var
 Add typedefs for template class args to make them visible to subclasses.
 
typedef UpDownTemplate
< SharedMemVariable
UpDown
 
typedef SharedMemHistogram Hist
 
typedef FakeTimedVariable TVar
 
- Static Public Attributes inherited from net_instaweb::Statistics
static const char kDefaultGroup []
 Default group for use with AddTimedVariable.
 

Member Function Documentation

virtual StatisticsLogger* net_instaweb::SharedMemStatistics::console_logger ( )
inlinevirtual
Todo:
TODO(sligocki): Rename to statistics_logger().

Reimplemented from net_instaweb::Statistics.

void net_instaweb::SharedMemStatistics::GlobalCleanup ( MessageHandler message_handler)

This should be called from the root process as it is about to exit, when no further children are expected to start.

static void net_instaweb::SharedMemStatistics::GlobalCleanup ( AbstractSharedMem shm_runtime,
const GoogleString segment_name,
MessageHandler message_handler 
)
static

Like above, but can be done after object got cleaned up, by passing a saved SegmentName(). Precondition: init must have returned 'true'.

bool net_instaweb::SharedMemStatistics::Init ( bool  parent,
MessageHandler message_handler 
)

This method initializes or attaches to shared memory. You should call this exactly once in each process/thread, after all calls to AddVariables, AddHistograms and SetSuggestedNumBuckets (as well as any other histogram range configurations) have been done.

The root process (the one that starts all the other child threads and processes) must be the first one to make the call, with parent = true, with all other calling it with = false.

Returns true if successful.


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