19 #ifndef _STATSKEEPER_HPP_
20 #define _STATSKEEPER_HPP_
27 #include <boost/thread.hpp>
28 #include <boost/thread/mutex.hpp>
29 #include <boost/thread/locks.hpp>
30 #include <boost/shared_ptr.hpp>
64 unsigned long int hl = 12);
75 void increment (std::string
id,
double value = 1);
76 void decrement (std::string
id,
double value = 1);
87 StatsKeeper& operator=(StatsKeeper
const&){
kisscpp::LogStream log(__PRETTY_FUNCTION__); };
89 StatsKeeper(
unsigned long int gp,
90 unsigned long int hl) :
101 static StatsKeeper *singleton_instance;
102 unsigned long int gatherPeriod;
103 unsigned long int historyLength;
105 boost::mutex statMutex;
106 boost::thread_group threadGroup;
114 #endif // _STATSKEEPER_HPP_
GatheredStatsMapType::iterator GatheredStatsMapTypeIterator
Definition: statskeeper.hpp:38
Definition: statskeeper.hpp:60
void stop()
Definition: statskeeper.cpp:47
StatsHistoryMapType::iterator StatsHistoryMapTypeIterator
Definition: statskeeper.hpp:46
boost::shared_ptr< StatsMapType > SharedStatsMapType
Definition: statskeeper.hpp:42
void addStatableQueue(std::string id, sharedStatAbleQ ssq)
Definition: statskeeper.cpp:83
SharedStatsMapType getCurrentStats()
Definition: statskeeper.cpp:89
SharedStatsMapType getLastGatheredStats()
Definition: statskeeper.cpp:112
StatsMapType::iterator StatsMapTypeIterator
Definition: statskeeper.hpp:41
SharedStatsHistoryMapType getFullStatsHistory()
Definition: statskeeper.cpp:128
QueueStatsMapType::iterator QueueStatsMapTypeIterator
Definition: statskeeper.hpp:50
~StatsKeeper()
Definition: statskeeper.hpp:68
boost::shared_ptr< StatsHistoryMapType > SharedStatsHistoryMapType
Definition: statskeeper.hpp:47
static StatsKeeper * instance(unsigned long int gp=300, unsigned long int hl=12)
Definition: statskeeper.cpp:26
boost::shared_ptr< StatAbleQueue > sharedStatAbleQ
Definition: statable_queue.hpp:20
std::map< std::string, sharedStatAbleQ > QueueStatsMapType
Definition: statskeeper.hpp:49
std::map< std::string, StatsHistoryType > StatsHistoryMapType
Definition: statskeeper.hpp:45
std::map< std::string, double > StatsMapType
Definition: statskeeper.hpp:40
Definition: logstream.hpp:145
void setStatValue(std::string id, double value=0)
Definition: statskeeper.cpp:54
std::map< std::string, std::deque< double > > GatheredStatsMapType
Definition: statskeeper.hpp:37
void start()
Definition: statskeeper.cpp:37
void increment(std::string id, double value=1)
Definition: statskeeper.cpp:61
void decrement(std::string id, double value=1)
Definition: statskeeper.cpp:72
std::vector< double > StatsHistoryType
Definition: statskeeper.hpp:44