17 #ifndef PAGESPEED_KERNEL_SHAREDMEM_SHARED_MEM_STATISTICS_H_
18 #define PAGESPEED_KERNEL_SHAREDMEM_SHARED_MEM_STATISTICS_H_
31 namespace net_instaweb {
35 class StatisticsLogger;
60 virtual StringPiece GetName()
const {
return name_; }
65 virtual int64 SetReturningPreviousValueLockHeld(int64 value);
69 friend class SharedMemTimedVariable;
87 volatile int64* value_ptr_;
97 virtual void Add(
double value);
131 virtual double PercentileInternal(
const double perc);
132 virtual double StandardDeviationInternal();
133 virtual double CountInternal();
134 virtual double MaximumInternal();
135 virtual double MinimumInternal();
140 friend class SharedMemStatistics;
141 void AttachTo(AbstractSharedMemSegment* segment,
size_t offset,
142 MessageHandler* message_handler);
146 double BucketWidth();
150 int FindBucket(
double value);
152 void DCheckRanges()
const;
154 void ClearInternal();
156 scoped_ptr<AbstractMutex> mutex_;
158 struct HistogramBody {
160 bool enable_negative_;
172 double sum_of_squares_;
178 HistogramBody* buffer_;
183 SharedMemVariable, SharedMemHistogram, FakeTimedVariable> {
186 int64 max_logfile_size_kb,
187 const StringPiece& logging_file,
bool logging,
220 return console_logger_.get();
226 virtual Hist* NewHistogram(StringPiece name);
231 bool InitMutexes(
size_t per_var,
MessageHandler* message_handler);
virtual double AverageInternal()
Note that these *Internal interfaces require the mutex to be held.
virtual void SetSuggestedNumBuckets(int i)
TimeDVariable.
Definition: statistics_template.h:358
virtual void Add(double value)
Record a value in its bucket.
bool Init(bool parent, MessageHandler *message_handler)
virtual UpDown * NewUpDownCounter(StringPiece name)
Interface to subclass.
virtual void SetMinValue(double value)
Set the minimum value allowed in histogram.
virtual int64 GetLockHeld() const
Get/Setters that may only be called if you already hold the mutex.
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
Abstract interface for implementing a mutex.
Definition: abstract_mutex.h:28
Definition: shared_mem_statistics.h:182
virtual double BucketStart(int index)
void GlobalCleanup(MessageHandler *message_handler)
Definition: scoped_ptr.h:30
virtual Var * NewVariable(StringPiece name)
Interface to subclass.
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual double BucketCount(int index)
Value of a bucket.
Definition: abstract_shared_mem.h:86
Definition: shared_mem_statistics.h:92
virtual int NumBuckets()
Returns number of buckets the histogram actually has.
Definition: file_system.h:76
virtual void EnableNegativeBuckets()
VarTemplate< SharedMemVariable > Var
Add typedefs for template class args to make them visible to subclasses.
Definition: statistics_template.h:363
Definition: statistics.h:138
Definition: shared_mem_statistics.h:56
Definition: statistics.h:112
virtual size_t SharedMutexSize() const =0
Size of mutexes inside shared memory segments.
Definition: shared_mem_statistics_test_base.h:36
virtual void SetMaxValue(double value)
virtual void Clear()
Throw away all data.
Definition: message_handler.h:39
size_t AllocationSize(AbstractSharedMem *shm_runtime)
Definition: shared_mem_statistics.h:119
Definition: abstract_shared_mem.h:31
virtual StatisticsLogger * console_logger()
Definition: shared_mem_statistics.h:219
Timer interface, made virtual so it can be mocked for tests.
Definition: timer.h:27
Definition: statistics_logger.h:42