CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DataRetrieverMonitorCollection.h
Go to the documentation of this file.
1 // $Id: DataRetrieverMonitorCollection.h,v 1.1.2.8 2011/03/01 08:32:14 mommsen Exp $
3 
4 #ifndef EventFilter_SMProxyServer_DataRetrieverMonitorCollection_h
5 #define EventFilter_SMProxyServer_DataRetrieverMonitorCollection_h
6 
14 
15 #include <boost/shared_ptr.hpp>
16 #include <boost/thread.hpp>
17 
18 #include <map>
19 #include <string>
20 #include <vector>
21 
22 
23 namespace smproxy {
24 
34  {
35  public:
36 
38 
39  struct SummaryStats
40  {
41  size_t registeredSMs;
42  size_t activeSMs;
44 
45  typedef std::pair<stor::RegPtr, stor::MonitoredQuantity::Stats> EventTypeStats;
46  typedef std::vector<EventTypeStats> EventTypeStatList;
48  };
49 
50  typedef std::map<std::string, stor::MonitoredQuantity::Stats> ConnectionStats;
51 
53  {
57 
58  bool operator<(const EventTypeStats&) const;
59  };
60  typedef std::vector<EventTypeStats> EventTypeStatList;
61 
62 
63  explicit DataRetrieverMonitorCollection(const stor::utils::Duration_t& updateInterval);
64 
70 
75 
81 
86  bool addRetrievedSample(const ConnectionID&, const unsigned int& size);
87 
91  void getSummaryStats(SummaryStats&) const;
92 
97 
102 
103 
104  private:
105 
107 
109  {
113 
115  (
116  stor::RegPtr,
117  const stor::utils::Duration_t& updateInterval
118  );
119  };
120 
121  //Prevent copying of the DataRetrieverMonitorCollection
124 
126  typedef boost::shared_ptr<DataRetrieverMQ> DataRetrieverMQPtr;
127  typedef std::map<ConnectionID, DataRetrieverMQPtr> RetrieverMqMap;
129 
130  typedef std::map<std::string, stor::MonitoredQuantityPtr> ConnectionMqMap;
132 
135 
136  virtual void do_calculateStatistics();
137  virtual void do_reset();
138  // virtual void do_appendInfoSpaceItems(InfoSpaceItems&);
139  // virtual void do_updateInfoSpaceItems();
140 
142  {
143  public:
144 
146  : updateInterval_(updateInterval) {}
147 
148  bool insert(const stor::RegPtr);
149  bool addSample(const stor::RegPtr, const double& sizeKB);
151  void calculateStatistics();
152  void clear();
153 
154  private:
155 
156  bool insert(const stor::EventConsRegPtr);
157  bool insert(const stor::DQMEventConsRegPtr);
158  bool addSample(const stor::EventConsRegPtr, const double& sizeKB);
159  bool addSample(const stor::DQMEventConsRegPtr, const double& sizeKB);
160 
165 
170 
172  };
173 
175 
176  };
177 
178  std::ostream& operator<<(std::ostream&, const DataRetrieverMonitorCollection::ConnectionStatus&);
179 
180 
181 } // namespace smproxy
182 
183 #endif // EventFilter_SMProxyServer_DataRetrieverMonitorCollection_h
184 
185 
std::ostream & operator<<(std::ostream &os, ConnectionID id)
Definition: ConnectionID.h:65
boost::shared_ptr< RegistrationInfoBase > RegPtr
boost::shared_ptr< MonitoredQuantity > MonitoredQuantityPtr
static boost::mutex mutex
Definition: LHEProxy.cc:11
bool setConnectionStatus(const ConnectionID &, const ConnectionStatus &)
bool getEventTypeStatsForConnection(const ConnectionID &, EventTypeStats &)
std::pair< stor::RegPtr, stor::MonitoredQuantity::Stats > EventTypeStats
DataRetrieverMonitorCollection(const stor::utils::Duration_t &updateInterval)
boost::shared_ptr< stor::EventConsumerRegistrationInfo > EventConsRegPtr
std::map< std::string, stor::MonitoredQuantityPtr > ConnectionMqMap
dictionary map
Definition: Association.py:160
bool addRetrievedSample(const ConnectionID &, const unsigned int &size)
boost::posix_time::time_duration Duration_t
Definition: Utils.h:41
std::map< stor::EventConsRegPtr, stor::MonitoredQuantityPtr, stor::utils::ptrComp< stor::EventConsumerRegistrationInfo > > EventMap
boost::shared_ptr< DataRetrieverMQ > DataRetrieverMQPtr
std::map< ConnectionID, DataRetrieverMQPtr > RetrieverMqMap
std::map< std::string, stor::MonitoredQuantity::Stats > ConnectionStats
DataRetrieverMonitorCollection & operator=(DataRetrieverMonitorCollection const &)
DataRetrieverMQ(stor::RegPtr, const stor::utils::Duration_t &updateInterval)
EventTypeMqMap(const stor::utils::Duration_t &updateInterval)
tuple size
Write out results.
boost::shared_ptr< stor::DQMEventConsumerRegistrationInfo > DQMEventConsRegPtr
std::map< stor::DQMEventConsRegPtr, stor::MonitoredQuantityPtr, stor::utils::ptrComp< stor::DQMEventConsumerRegistrationInfo > > DQMEventMap