diff options
author | storri <storri@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-06-20 22:55:22 +0000 |
---|---|---|
committer | storri <storri@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-06-20 22:55:22 +0000 |
commit | 94fce07fc07cc1cf475d4ec451502656b831bf8a (patch) | |
tree | 007ab4dd5b920bfb939ea4779238559083383a14 /ace/Metrics_Cache_T.h | |
parent | 928072207ae6a7efcff739e70b91f01d14fc6eed (diff) | |
download | ATCD-94fce07fc07cc1cf475d4ec451502656b831bf8a.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace/Metrics_Cache_T.h')
-rw-r--r-- | ace/Metrics_Cache_T.h | 110 |
1 files changed, 61 insertions, 49 deletions
diff --git a/ace/Metrics_Cache_T.h b/ace/Metrics_Cache_T.h index a67e13ace9b..b2685ca95a8 100644 --- a/ace/Metrics_Cache_T.h +++ b/ace/Metrics_Cache_T.h @@ -1,4 +1,13 @@ -// $Id$ +//============================================================================= +/** + * @file Metrics_Cache_T.h + * + * $Id$ + * + * @author Chris Gill <cdgill@cse.wustl.edu> + */ +//============================================================================= + #ifndef METRICS_CACHE_T_H #define METRICS_CACHE_T_H @@ -21,16 +30,18 @@ #define METRICS_DEFAULT_TIMEPROBE_TABLE_SIZE METRICS_MIN_TIMEPROBE_TABLE_SIZE #define METRICS_DEFAULT_TIMEPROBE_COUNT 6 +/** + * @class ACE_Metrics_Timeprobe + * + * @brief This class implements a timeprobe for use in a Metrics framework. + * + * This class provides a probe for specific thread and method call + * metrics timing points. + */ template <class ACE_LOCK, class ALLOCATOR> class ACE_Metrics_Timeprobe : public ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR> { - // = TITLE - // This class implements a timeprobe for use in a Metrics framework. - // - // = DESCRIPTION - // This class provides a probe for specific thread and method call - // metrics timing points. public: typedef ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> @@ -40,6 +51,7 @@ public: typedef ACE_METRICS_TIMEPROBE_TYPE* ACE_METRICS_TIMEPROBE_BASED_PTR_TYPE; typedef char* ACE_METRICS_NAME_BASED_PTR_TYPE; + // Enumerated timeprobe event types. enum event_id { WORK_START = 0, @@ -47,46 +59,45 @@ public: WORK_SUSPEND = 2, WORK_RESUME = 3 }; - // Enumerated timeprobe event types. + // Default constructor: plugs in the above event descriptions. ACE_Metrics_Timeprobe (u_int id = 0, const char *name = 0, u_long size = METRICS_DEFAULT_TIMEPROBE_TABLE_SIZE); - // Default constructor: plugs in the above event descriptions. + // Constructor with allocator: plugs in the above event descriptions. ACE_Metrics_Timeprobe (ALLOCATOR *allocatorPtr, u_int id = 0, const char *name = 0, u_long size = METRICS_DEFAULT_TIMEPROBE_TABLE_SIZE); - // Constructor with allocator: plugs in the above event descriptions. - virtual ~ACE_Metrics_Timeprobe (); // Destructor. + virtual ~ACE_Metrics_Timeprobe (); + // Returns true if a timeprobe event matches the passed id. int is_event (const ACE_METRICS_TIMEPROBE_DATA_TYPE &t, ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::event_id id); - // Returns true if a timeprobe event matches the passed id. + // Accessor and mutator for probe name. const char * probe_name (void); void probe_name (char * name); - // Accessor and mutator for probe name. - u_int probe_id (void); // Accessor for probe id. + u_int probe_id (void); - void probe_id (u_int id); // Mutator for probe id. + void probe_id (u_int id); - void flush_ACE_Metrics_Timeprobe (); // Flush the ACE metrics timeprobe into shared memory. + void flush_ACE_Metrics_Timeprobe (); protected: - u_int id_; // Identifier for the timeprobe. + u_int id_; - char* name_; // Name of the timeprobe. + char* name_; private: @@ -95,113 +106,114 @@ private: void operator =(const ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> &); }; - +/** + * @class ACE_Metrics_Cache + * + * @brief This class implements a cache for metrics timeprobe data. + * + * This class allows probes to be recorded into a single cache that + * monitors and other higher level metrics classes can query. + */ template <class ACE_LOCK, class ALLOCATOR> class ACE_Metrics_Cache { - // = TITLE - // This class implements a cache for metrics timeprobe data. - // - // = DESCRIPTION - // This class allows probes to be recorded into a single cache that - // monitors and other higher level metrics classes can query. public: typedef ACE_Metrics_Cache <ACE_LOCK, ALLOCATOR> ACE_METRICS_CACHE_TYPE; + // Default constructor. ACE_Metrics_Cache (u_long table_size = METRICS_DEFAULT_TIMEPROBE_TABLE_SIZE, u_long number_of_probes = METRICS_DEFAULT_TIMEPROBE_COUNT, ALLOCATOR * allocatorPtr = (ALLOCATOR*)ALLOCATOR::instance()); - // Default constructor. - ~ACE_Metrics_Cache (); // Destructor. + ~ACE_Metrics_Cache (); // = Dispatching metrics. + // Report start, stop, suspend, and resume times of a dispatch + // enqueue: stores data metrics on the supplier side. void report_enqueue_start (u_long i); void report_enqueue_stop (u_long i); void report_enqueue_suspend (u_long i); void report_enqueue_resume (u_long i); - // Report start, stop, suspend, and resume times of a dispatch - // enqueue: stores data metrics on the supplier side. + // Report start, stop, suspend, and resume times of a dispatch + // dequeue: stores data metrics on the supplier side.. void report_dequeue_start (u_long i); void report_dequeue_stop (u_long i); void report_dequeue_suspend (u_long i); void report_dequeue_resume (u_long i); - // Report start, stop, suspend, and resume times of a dispatch - // dequeue: stores data metrics on the supplier side.. - void reset_base_statistics (); // Reset the metrics data on the consumer side. + void reset_base_statistics (); - void flip_supplier_and_consumer (); // Flips the supplier and consumer sides. + void flip_supplier_and_consumer (); - void flush_ACE_Metrics_Cache (); // Flush the ACE metrics cache into shared memory. + void flush_ACE_Metrics_Cache (); - void metrics_enabled(int enabled); // Set the enable state for metrics collection. + void metrics_enabled(int enabled); - int metrics_enabled(void) const; // Return the enable state for metrics collection. + int metrics_enabled(void) const; protected: - ALLOCATOR * allocator (void); // Obtain an allocator pointer correctly thunked for the current // address space. If there is no allocator stored in the instance, // the singleton allocator in the current process is used. + ALLOCATOR * allocator (void); // = Implementation members. - u_long probe_set_size_; // Number of probes in each supplier/consumer set. + u_long probe_set_size_; + // Probe data counts for each supplier/consumer set. u_long * enqueue_count_ [2]; u_long * dequeue_count_ [2]; - // Probe data counts for each supplier/consumer set. + // Probes for each supplier/consumer set. ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> ** enqueue_probes_ [2]; ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> ** dequeue_probes_ [2]; - // Probes for each supplier/consumer set. + // Names for the probes. char ** enqueue_names_; char ** dequeue_names_; - // Names for the probes. - int consumer_index_; // Index from which probe events are being consumed. // for WSOA, it's the data being sent to the logger + int consumer_index_; - int supplier_index_; // Index to which probe events are being supplied. // for WSOA, it's the data being recorded from the probes + int supplier_index_; - u_long table_size_; // Size of the timestamp table in each probe. + u_long table_size_; - ACE_Time_Value interval_start_; // Interval start and stop timestamps. + ACE_Time_Value interval_start_; - ACE_Time_Value interval_end_; // Interval start and stop timestamps. + ACE_Time_Value interval_end_; - int interval_initialized_; // Flag to indicate whether or not start time of interval has been // initialized since the last reset. + int interval_initialized_; - int metrics_enabled_; // Indicator of whether metrics is enabled. + int metrics_enabled_; private: - ALLOCATOR* allocator_; // Allocation strategy object. + ALLOCATOR* allocator_; // Declare but do not define. ACE_Metrics_Cache (const ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR> &); |