00001 #ifndef STOR_FOREVER_COUNTER_H 00002 #define STOR_FOREVER_COUNTER_H 00003 00012 #include "EventFilter/StorageManager/interface/BaseCounter.h" 00013 #include "boost/thread/recursive_mutex.hpp" 00014 00015 namespace stor 00016 { 00017 class ForeverCounter : public BaseCounter 00018 { 00019 00020 public: 00021 00022 ForeverCounter(); 00023 00024 void addSample(double value = 1.0); 00025 long long getSampleCount(); 00026 double getSampleRate(double currentTime = getCurrentTime()); 00027 double getValueSum(); 00028 double getValueAverage(); 00029 double getValueRate(double currentTime = getCurrentTime()); 00030 double getDuration(double currentTime = getCurrentTime()); 00031 00032 private: 00033 00034 long long sampleCount_; 00035 double startTime_; 00036 double currentTotal_; 00037 00038 boost::recursive_mutex dataMutex_; 00039 00040 }; 00041 } 00042 00043 #endif