CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
ora::SessionMonitoringData Class Reference

#include <Monitoring.h>

Public Member Functions

size_t newTransaction ()
 
size_t numberOfTransactions () const
 
void report (std::ostream &out) const
 
 SessionMonitoringData (boost::posix_time::ptime start, const std::string &connectionString)
 
void stop ()
 
size_t stopTransaction (bool commit_status=true)
 
 ~SessionMonitoringData ()
 

Public Attributes

std::string m_connectionString
 
boost::posix_time::ptime m_start
 
boost::posix_time::ptime m_stop
 

Private Attributes

TransactionMonitoringDatam_currentTransaction
 
size_t m_ncur
 
std::map< std::string,
TransactionMonitoringData * > 
m_transactions
 

Detailed Description

Definition at line 21 of file Monitoring.h.

Constructor & Destructor Documentation

ora::SessionMonitoringData::SessionMonitoringData ( boost::posix_time::ptime  start,
const std::string &  connectionString 
)

Definition at line 19 of file Monitoring.cc.

19  :
20  m_connectionString( connectionString ),
21  m_start(start),
22  m_stop(boost::posix_time::neg_infin),
25  m_ncur(0){
26 }
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
std::string m_connectionString
Definition: Monitoring.h:30
boost::posix_time::ptime m_stop
Definition: Monitoring.h:32
TransactionMonitoringData * m_currentTransaction
Definition: Monitoring.h:34
std::map< std::string, TransactionMonitoringData * > m_transactions
Definition: Monitoring.h:35
boost::posix_time::ptime m_start
Definition: Monitoring.h:31
ora::SessionMonitoringData::~SessionMonitoringData ( )

Definition at line 28 of file Monitoring.cc.

28  {
29  for(std::map<std::string,TransactionMonitoringData*>::const_iterator iT = m_transactions.begin();
30  iT != m_transactions.end();iT++ ){
31  delete iT->second;
32  }
33 }
std::map< std::string, TransactionMonitoringData * > m_transactions
Definition: Monitoring.h:35

Member Function Documentation

size_t ora::SessionMonitoringData::newTransaction ( )

Definition at line 35 of file Monitoring.cc.

References ora::guidFromTime().

35  {
36  m_currentTransaction = new TransactionMonitoringData( boost::posix_time::microsec_clock::universal_time() );
37  m_transactions.insert(std::make_pair(guidFromTime(),m_currentTransaction));
38  m_ncur = m_transactions.size();
39  return m_ncur;
40 }
TransactionMonitoringData * m_currentTransaction
Definition: Monitoring.h:34
std::map< std::string, TransactionMonitoringData * > m_transactions
Definition: Monitoring.h:35
std::string guidFromTime()
Definition: Guid.cc:37
size_t ora::SessionMonitoringData::numberOfTransactions ( ) const

Definition at line 59 of file Monitoring.cc.

59  {
60  return m_transactions.size();
61 }
std::map< std::string, TransactionMonitoringData * > m_transactions
Definition: Monitoring.h:35
void ora::SessionMonitoringData::report ( std::ostream &  out) const

Definition at line 63 of file Monitoring.cc.

References data, i, ora::TransactionMonitoringData::m_start, ora::TransactionMonitoringData::m_status, ora::TransactionMonitoringData::m_stop, and AlCaHLTBitMon_QueryRunRegistry::string.

63  {
64  size_t i=1;
65  for(std::map<std::string,TransactionMonitoringData*>::const_iterator iT = m_transactions.begin();
66  iT != m_transactions.end();iT++ ){
67  TransactionMonitoringData& data = *iT->second;
68  boost::posix_time::time_duration duration;
69  if( !data.m_stop.is_neg_infinity() ){
70  duration = data.m_stop-data.m_start;
71  }
72  out <<" -> Transaction #"<<i<<" duration="<<boost::posix_time::to_simple_string(duration)<<" status="<<(data.m_status?std::string("COMMIT"):std::string("ROLLBACK"))<<std::endl;
73  i++;
74  }
75 }
int i
Definition: DBlmapReader.cc:9
tuple out
Definition: dbtoconf.py:99
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::map< std::string, TransactionMonitoringData * > m_transactions
Definition: Monitoring.h:35
void ora::SessionMonitoringData::stop ( )

Definition at line 53 of file Monitoring.cc.

53  {
54  m_stop = boost::posix_time::microsec_clock::universal_time();
56  m_ncur = 0;
57 }
boost::posix_time::ptime m_stop
Definition: Monitoring.h:32
TransactionMonitoringData * m_currentTransaction
Definition: Monitoring.h:34
size_t ora::SessionMonitoringData::stopTransaction ( bool  commit_status = true)

Definition at line 42 of file Monitoring.cc.

42  {
43  size_t ncur = 0;
45  m_currentTransaction->stop( commit_status );
47  ncur = m_ncur;
48  m_ncur = 0;
49  }
50  return ncur;
51 }
TransactionMonitoringData * m_currentTransaction
Definition: Monitoring.h:34
void stop(bool commit_status=true)
Definition: Monitoring.cc:14

Member Data Documentation

std::string ora::SessionMonitoringData::m_connectionString

Definition at line 30 of file Monitoring.h.

Referenced by ora::Monitoring::report().

TransactionMonitoringData* ora::SessionMonitoringData::m_currentTransaction
private

Definition at line 34 of file Monitoring.h.

size_t ora::SessionMonitoringData::m_ncur
private

Definition at line 36 of file Monitoring.h.

boost::posix_time::ptime ora::SessionMonitoringData::m_start

Definition at line 31 of file Monitoring.h.

Referenced by ora::Monitoring::report().

boost::posix_time::ptime ora::SessionMonitoringData::m_stop

Definition at line 32 of file Monitoring.h.

Referenced by ora::Monitoring::report().

std::map<std::string,TransactionMonitoringData*> ora::SessionMonitoringData::m_transactions
private

Definition at line 35 of file Monitoring.h.