Page Speed Optimization Libraries
1.13.35.1
|
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 StatisticsLogger * | console_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 SharedMemHistogram * | AddHistogram (const StringPiece &name) |
virtual SharedMemHistogram * | FindHistogram (const StringPiece &name) const |
Find a histogram from a name, returning NULL if not found. | |
virtual FakeTimedVariable * | AddTimedVariable (const StringPiece &name, const StringPiece &group) |
virtual FakeTimedVariable * | 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 | |
UpDownCounter * | GetUpDownCounter (const StringPiece &name) const |
Find a variable from a name, aborting if not found. | |
Variable * | GetVariable (const StringPiece &name) const |
Find a variable from a name, aborting if not found. | |
Histogram * | GetHistogram (const StringPiece &name) const |
Find a histogram from a name, aborting if not found. | |
TimedVariable * | GetTimedVariable (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 Var * | NewVariable (StringPiece name) |
Interface to subclass. | |
virtual UpDown * | NewUpDownCounter (StringPiece name) |
Interface to subclass. | |
virtual Hist * | NewHistogram (StringPiece name) |
Protected Member Functions inherited from net_instaweb::ScalarStatisticsTemplate< SharedMemVariable, SharedMemHistogram, FakeTimedVariable > | |
virtual TVar * | NewTimedVariable (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 |
SharedMemHistogram * | histograms (size_t pos) |
const GoogleString & | histogram_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. | |
|
inlinevirtual |
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 |
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.