1. binet
  2. mana-core-perfmonkernel

Commits

bi...@4525493e-7705-40b1-a816-d608a930855b  committed 09a5714

support new IAuditor interface

  • Participants
  • Parent commits 2999599
  • Branches default
  • Tags PerfMonKernel-00-08-00

Comments (0)

Files changed (3)

File ChangeLog

View file
  • Ignore whitespace
+2008-06-26  Sebastien Binet  <binet@lblbox>
+
+	* tagging PerfMonKernel-00-08-00
+	* support new IAuditor interface
+	* M PerfMonKernel/IPerfMonSvc.h
+	* M PerfMonKernel/PerfMonDefs.h
+
 2008-04-10  Sebastien Binet  <binet@lblbox>
 
 	* tagging PerfMonKernel-00-07-00

File PerfMonKernel/IPerfMonSvc.h

View file
  • Ignore whitespace
 
 // FrameWork includes
 #include "GaudiKernel/IMonitorSvc.h"
+#include "GaudiKernel/INamedInterface.h"
 
 // PerfMonKernel includes
 #include "PerfMonKernel/PerfMonDefs.h"
 
 // forward declaration
 namespace AIDA { class IBaseHistogram; }
-class INamedInterface;
 namespace PerfMon { class ScopedMonitor; }
 
 class IPerfMonSvc : virtual public IMonitorSvc
   /** Start collecting monitoring data for a given component, for a given
    *  step of the Gaudi FSM
    */
-  virtual void startAud( PerfMon::State::Type step,
+  virtual void startAud( const std::string& stepName,
 			 const std::string& compName = "PerfMonSlice" ) = 0;
 
   /** Stop collecting monitoring data for a given component, for a given
    *  step of the Gaudi FSM
    */
-  virtual void stopAud( PerfMon::State::Type step,
+  virtual void stopAud( const std::string& stepName,
 			const std::string& compName = "PerfMonSlice" ) = 0;
 
   /////////////////////////////////////////////////////////////////// 
   void setMonState( PerfMon::State::Type step )
   { m_monState = step; }
 
-  /** Start collecting monitoring data on behalf of @a requester, with some
-   *  user provided label @a item
-   */
-  virtual void startAud( const std::string& item,
-			 const INamedInterface& requester ) = 0;
-
-  /** Stop collecting monitoring data on behalf of @a requester, with some
-   *  user provided label @a item
-   */
-  virtual void stopAud ( const std::string& item,
-			 const INamedInterface& requester ) = 0;
-
   /////////////////////////////////////////////////////////////////// 
   // Private methods: 
   /////////////////////////////////////////////////////////////////// 
 /// simple helper class using RAII to start/stop monitoring
 class ScopedMonitor
 {
-  /// the label of this monitor helper
-  std::string m_item;
-  /// the component which asked to start a perf audit
-  const INamedInterface& m_requester;
+  /// the label of this monitor helper: requester_name+'_@@_'+item_from_user
+  std::string m_label;
   /// the pointer to the performance monitoring service
   IPerfMonSvc* m_monSvc;
   
   ScopedMonitor();// not implemented
+  inline 
+  static const std::string& label() 
+  { static const std::string s_label = "usr"; return s_label; }
+
  public:
-  ScopedMonitor( const std::string& item, 
-		 const INamedInterface& requester ) :
-    m_item     ( item ),
-    m_requester( requester ),
+  ScopedMonitor( const INamedInterface& requester,
+		 const std::string& item ) :
+    m_label    ( requester.name() +"_@@_"+ item ),
     m_monSvc   ( IPerfMonSvc::instance() )
   {
-    if (m_monSvc) m_monSvc->startAud( m_item, m_requester );
+    if (m_monSvc) m_monSvc->startAud (label(), m_label);
   }
   ~ScopedMonitor()
   {
-    if (m_monSvc) m_monSvc->stopAud ( m_item, m_requester );
+    if (m_monSvc) m_monSvc->stopAud  (label(), m_label);
   }
 };
 } //> namespace PerfMon

File PerfMonKernel/PerfMonDefs.h

View file
  • Ignore whitespace
       //run,
       evt,
       fin,
+      cbk,
 
       // keep last !
       Size
     "ini", 
     //"run", 
     "evt", 
-    "fin" 
+    "fin",
+    "cbk"
     }
   };