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.3 2011/05/09 11:03:25 mommsen Exp $
3 
4 #ifndef EventFilter_SMProxyServer_DataRetrieverMonitorCollection_h
5 #define EventFilter_SMProxyServer_DataRetrieverMonitorCollection_h
6 
16 
17 #include <boost/shared_ptr.hpp>
18 #include <boost/thread.hpp>
19 
20 #include <map>
21 #include <string>
22 #include <vector>
23 
24 
25 namespace smproxy {
26 
36  {
37  public:
38 
40 
41  struct EventStats
42  {
45  };
46 
47  struct SummaryStats
48  {
49  size_t registeredSMs;
50  size_t activeSMs;
52 
53  typedef std::pair<stor::RegPtr, EventStats> EventTypeStats;
54  typedef std::vector<EventTypeStats> EventTypeStatList;
56  };
57 
58  typedef std::map<std::string, EventStats> ConnectionStats;
59 
61  {
65 
66  bool operator<(const EventTypePerConnectionStats&) const;
67  };
68  typedef std::vector<EventTypePerConnectionStats> EventTypePerConnectionStatList;
69 
70 
72  (
73  const stor::utils::Duration_t& updateInterval,
75  );
76 
82 
87 
93 
98  bool addRetrievedSample(const ConnectionID&, const unsigned int& size);
99 
105 
109  void getSummaryStats(SummaryStats&) const;
110 
115 
120 
124  void configureAlarms(AlarmParams const&);
125 
126  private:
127 
128  struct EventMQ
129  {
132 
133  EventMQ(const stor::utils::Duration_t& updateInterval);
134  void getStats(EventStats&) const;
135  void calculateStatistics();
136  void reset();
137  };
138  typedef boost::shared_ptr<EventMQ> EventMQPtr;
139 
141  {
145 
147  (
148  stor::RegPtr,
149  const stor::utils::Duration_t& updateInterval
150  );
151  };
152 
153  //Prevent copying of the DataRetrieverMonitorCollection
156 
159 
162 
163  typedef boost::shared_ptr<DataRetrieverMQ> DataRetrieverMQPtr;
164  typedef std::map<ConnectionID, DataRetrieverMQPtr> RetrieverMqMap;
166 
167  typedef std::map<std::string, EventMQPtr> ConnectionMqMap;
169 
172 
173  void sendAlarms();
175  virtual void do_calculateStatistics();
176  virtual void do_reset();
177  // virtual void do_appendInfoSpaceItems(InfoSpaceItems&);
178  // virtual void do_updateInfoSpaceItems();
179 
181  {
182  public:
183 
185  : updateInterval_(updateInterval) {}
186 
187  bool insert(const stor::RegPtr);
188  bool addSample(const stor::RegPtr, const double& sizeKB);
191  void calculateStatistics();
192  void clear();
193 
194  private:
195 
196  bool insert(const stor::EventConsRegPtr);
197  bool insert(const stor::DQMEventConsRegPtr);
198  bool addSample(const stor::EventConsRegPtr, const double& sizeKB);
199  bool addSample(const stor::DQMEventConsRegPtr, const double& sizeKB);
202 
207 
212 
214  };
215 
217 
218  };
219 
220  std::ostream& operator<<(std::ostream&, const DataRetrieverMonitorCollection::ConnectionStatus&);
221 
222 
223 } // namespace smproxy
224 
225 #endif // EventFilter_SMProxyServer_DataRetrieverMonitorCollection_h
226 
227 
std::ostream & operator<<(std::ostream &os, ConnectionID id)
Definition: ConnectionID.h:65
std::map< std::string, EventStats > ConnectionStats
boost::shared_ptr< RegistrationInfoBase > RegPtr
void getStatsByEventTypesPerConnection(EventTypePerConnectionStatList &) const
static boost::mutex mutex
Definition: LHEProxy.cc:11
bool setConnectionStatus(const ConnectionID &, const ConnectionStatus &)
boost::shared_ptr< stor::EventConsumerRegistrationInfo > EventConsRegPtr
dictionary map
Definition: Association.py:205
bool addRetrievedSample(const ConnectionID &, const unsigned int &size)
boost::posix_time::time_duration Duration_t
Definition: Utils.h:41
std::vector< EventTypePerConnectionStats > EventTypePerConnectionStatList
boost::shared_ptr< DataRetrieverMQ > DataRetrieverMQPtr
std::map< ConnectionID, DataRetrieverMQPtr > RetrieverMqMap
std::map< stor::DQMEventConsRegPtr, EventMQPtr, stor::utils::ptrComp< stor::DQMEventConsumerRegistrationInfo > > DQMEventMap
boost::shared_ptr< AlarmHandler > AlarmHandlerPtr
Definition: AlarmHandler.h:116
std::map< std::string, EventMQPtr > ConnectionMqMap
DataRetrieverMonitorCollection & operator=(DataRetrieverMonitorCollection const &)
DataRetrieverMQ(stor::RegPtr, const stor::utils::Duration_t &updateInterval)
EventTypeMqMap(const stor::utils::Duration_t &updateInterval)
EventMQ(const stor::utils::Duration_t &updateInterval)
std::map< stor::EventConsRegPtr, EventMQPtr, stor::utils::ptrComp< stor::EventConsumerRegistrationInfo > > EventMap
DataRetrieverMonitorCollection(const stor::utils::Duration_t &updateInterval, stor::AlarmHandlerPtr)
bool getEventTypeStatsForConnection(const ConnectionID &, EventTypePerConnectionStats &)
tuple size
Write out results.
boost::shared_ptr< stor::DQMEventConsumerRegistrationInfo > DQMEventConsRegPtr