test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SQLMonitoringService.h
Go to the documentation of this file.
1 #ifndef COND_SQLMONITORINGSERVICE_H
2 #define COND_SQLMONITORINGSERVICE_H
3 
4 #include "RelationalAccess/IMonitoringService.h"
5 #include "RelationalAccess/IMonitoringReporter.h"
6 
7 #include "CoralCommon/MonitoringReportTypes.h"
8 #include "CoralCommon/MonitoringEvent.h"
9 
10 #include "CoralKernel/Service.h"
11 
12 #include <string>
13 #include <map>
14 #include <vector>
15 
16 namespace coral
17 {
18  class MessageStream;
19 }
20 
21 namespace cond
22 {
24  typedef std::vector<coral::monitor::Event::Record> EventStream;
25 
30 
31  bool active;
34  };
35 
38  typedef std::map< std::string, SessionMonitor > Repository;
39 
40  class SQLMonitoringService : public coral::Service, virtual public coral::monitor::IMonitoringService, virtual public coral::IMonitoringReporter
41  {
42 
43  public:
44  explicit SQLMonitoringService( const std::string& );
45  virtual ~SQLMonitoringService();
46 
47  public:
54  virtual void setLevel( const std::string& contextKey, coral::monitor::Level level );
55 
59  virtual coral::monitor::Level level( const std::string& contextKey ) const;
60 
64  virtual bool active( const std::string& contextKey ) const;
65 
66  virtual void enable( const std::string& contextKey );
67  virtual void disable( const std::string& contextKey );
68 
72  virtual void record( const std::string& contextKey,
75  const std::string& description );
76 
80  virtual void record( const std::string& contextKey,
83  const std::string& description,
84  int data );
85 
89  virtual void record( const std::string& contextKey,
92  const std::string& description,
93  long long data );
94 
98  virtual void record( const std::string& contextKey,
101  const std::string& description,
102  double data );
103 
107  virtual void record( const std::string& contextKey,
108  coral::monitor::Source source,
110  const std::string& description,
111  const std::string& data );
112 
116  virtual const coral::IMonitoringReporter& reporter() const;
117 
118  //
119  // The coral::IMonitoringReporter interface implementation
120  //
121 
125  virtual std::set< std::string > monitoredDataSources() const;
126 
131  virtual void report( unsigned int level ) const;
132 
137  virtual void report( const std::string& contextKey, unsigned int level ) const;
138 
143  virtual void reportToOutputStream( const std::string& contextKey, std::ostream& os, unsigned int level ) const;
144 
145  void reportOnEvent( EventStream::const_iterator& it, std::ostream& os ) const;
146  void reportOnEvent( EventStream::const_iterator& it, coral::MessageStream& os ) const;
147 
148  void reportForSession( Repository::const_iterator& it, std::ostream& os ) const;
149  void reportForSession( Repository::const_iterator& it, coral::MessageStream& os ) const;
150  private:
151 
154  std::set<std::string> m_monitoredDS;
155  };
156 } // namespace cond
157 
158 #endif // COND_SQLMONITORINGSERVICE_H
SQLMonitoringService(const std::string &)
type
Definition: HCALResponse.h:21
virtual void disable(const std::string &contextKey)
void reportOnEvent(EventStream::const_iterator &it, std::ostream &os) const
virtual void record(const std::string &contextKey, coral::monitor::Source source, coral::monitor::Type type, const std::string &description)
virtual void reportToOutputStream(const std::string &contextKey, std::ostream &os, unsigned int level) const
virtual std::set< std::string > monitoredDataSources() const
virtual void report(unsigned int level) const
virtual void setLevel(const std::string &contextKey, coral::monitor::Level level)
std::vector< coral::monitor::Event::Record > EventStream
The raw stream of recorder monitoring events.
tuple description
Definition: idDealer.py:66
virtual const coral::IMonitoringReporter & reporter() const
The session related book-keeping of monitored events.
virtual void enable(const std::string &contextKey)
Repository m_events
The all events repository classified by the sessions&#39; keys.
void reportForSession(Repository::const_iterator &it, std::ostream &os) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
virtual coral::monitor::Level level(const std::string &contextKey) const
virtual bool active(const std::string &contextKey) const
std::set< std::string > m_monitoredDS
static std::string const source
Definition: EdmProvDump.cc:42
std::map< std::string, SessionMonitor > Repository
coral::monitor::Level level