#include <Metrics_Cache_T.h>
Collaboration diagram for ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >:
Public Types | |
typedef ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR > | ACE_METRICS_CACHE_TYPE |
Public Member Functions | |
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()) | |
~ACE_Metrics_Cache () | |
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) |
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) |
void | reset_base_statistics () |
void | flip_supplier_and_consumer () |
void | flush_ACE_Metrics_Cache () |
void | metrics_enabled (int enabled) |
int | metrics_enabled (void) const |
Protected Member Functions | |
ALLOCATOR * | allocator (void) |
Protected Attributes | |
u_long | probe_set_size_ |
u_long * | enqueue_count_ [2] |
u_long * | dequeue_count_ [2] |
ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR > ** | enqueue_probes_ [2] |
ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR > ** | dequeue_probes_ [2] |
char ** | enqueue_names_ |
char ** | dequeue_names_ |
int | consumer_index_ |
int | supplier_index_ |
u_long | table_size_ |
ACE_Time_Value | interval_start_ |
ACE_Time_Value | interval_end_ |
int | interval_initialized_ |
int | metrics_enabled_ |
Private Member Functions | |
ACE_Metrics_Cache (const ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR > &) | |
void | operator= (const ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR > &) |
Private Attributes | |
ALLOCATOR * | allocator_ |
This class allows probes to be recorded into a single cache that monitors and other higher level metrics classes can query.
Definition at line 122 of file Metrics_Cache_T.h.
|
Definition at line 126 of file Metrics_Cache_T.h. |
|
Definition at line 172 of file Metrics_Cache_T.cpp. References ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::dequeue_count_, ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::dequeue_probes_, ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::enqueue_count_, ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::enqueue_probes_, and ACE_High_Res_Timer::global_scale_factor().
00175 : probe_set_size_ (0), 00176 enqueue_names_ (0), 00177 dequeue_names_ (0), 00178 consumer_index_ (0), 00179 supplier_index_ (1), 00180 table_size_ (table_size), 00181 interval_start_ (ACE_Time_Value::zero), 00182 interval_end_ (ACE_Time_Value::zero), 00183 interval_initialized_ (0), 00184 metrics_enabled_(1), 00185 allocator_ (alloc) 00186 { 00187 ACE_UNUSED_ARG(number_of_probes); 00188 // Initialize probe and count arrays. 00189 00190 // Ensure that the high res timer global scale factor 00191 // is set before any of its static methods are used 00192 ACE_High_Res_Timer::global_scale_factor (); 00193 00194 enqueue_count_ [0] = 0; 00195 enqueue_count_ [1] = 0; 00196 dequeue_count_ [0] = 0; 00197 dequeue_count_ [1] = 0; 00198 enqueue_probes_ [0] = 0; 00199 enqueue_probes_ [1] = 0; 00200 dequeue_probes_ [0] = 0; 00201 dequeue_probes_ [1] = 0; 00202 } |
|
Definition at line 207 of file Metrics_Cache_T.cpp.
00208 { 00209 } |
|
|
|
Definition at line 217 of file Metrics_Cache_T.cpp. References ACE_Singleton< TYPE, ACE_LOCK >::instance().
00218 { 00219 ALLOCATOR * alloc = allocator_; 00220 return alloc 00221 ? alloc 00222 : ACE_Singleton<ALLOCATOR, ACE_LOCK>::instance (); 00223 } |
|
Definition at line 217 of file Metrics_Cache_T.inl. References ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::consumer_index_, and ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::supplier_index_.
00218 { 00219 int temp = consumer_index_; 00220 consumer_index_ = supplier_index_; 00221 supplier_index_ = temp; 00222 } |
|
Definition at line 230 of file Metrics_Cache_T.cpp.
00231 { 00232 } |
|
Definition at line 233 of file Metrics_Cache_T.inl. References ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::metrics_enabled_.
00234 { 00235 return metrics_enabled_; 00236 } |
|
Definition at line 226 of file Metrics_Cache_T.inl. References ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::metrics_enabled_.
00227 { 00228 metrics_enabled_ = enabled; 00229 } |
|
|
|
Definition at line 175 of file Metrics_Cache_T.inl. References ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::dequeue_count_, ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::dequeue_probes_, ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::probe_set_size_, and ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::supplier_index_.
00176 { 00177 if (i < this->probe_set_size_) 00178 { 00179 u_long & count = 00180 this->dequeue_count_ [this->supplier_index_] [i]; 00181 ++count; 00182 ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> * probe = 00183 this->dequeue_probes_ [this->supplier_index_][i]; 00184 probe-> 00185 timeprobe (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_RESUME); 00186 } 00187 } |
|
|
|
Definition at line 158 of file Metrics_Cache_T.inl. References ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::dequeue_count_, ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::dequeue_probes_, ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::probe_set_size_, and ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::supplier_index_.
00159 { 00160 if (i < this->probe_set_size_) 00161 { 00162 u_long & count = 00163 this->dequeue_count_ [this->supplier_index_] [i]; 00164 ++count; 00165 ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> * probe = 00166 this->dequeue_probes_ [this->supplier_index_][i]; 00167 probe-> 00168 timeprobe (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_SUSPEND); 00169 } 00170 } |
|
Definition at line 88 of file Metrics_Cache_T.inl. References ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::enqueue_count_, ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::enqueue_probes_, ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::probe_set_size_, and ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::supplier_index_.
00089 { 00090 if (i < this->probe_set_size_) 00091 { 00092 u_long & count = 00093 this->enqueue_count_ [this->supplier_index_] [i]; 00094 ++count; 00095 ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> * probe = 00096 this->enqueue_probes_ [this->supplier_index_][i]; 00097 probe-> 00098 timeprobe (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_RESUME); 00099 } 00100 } |
|
|
Definition at line 47 of file Metrics_Cache_T.inl. References ACE_hrtime_t, ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::enqueue_count_, ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::enqueue_probes_, ACE_OS::gethrtime(), ACE_High_Res_Timer::hrtime_to_tv(), ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::probe_set_size_, and ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::supplier_index_.
00048 { 00049 if (i < this->probe_set_size_) 00050 { 00051 // Take the metrics timeprobe first, to avoid measuring the below 00052 // metrics processing. 00053 ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> * probe = 00054 this->enqueue_probes_ [this->supplier_index_][i]; 00055 probe-> 00056 timeprobe (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_STOP); 00057 00058 ACE_hrtime_t hrtime_now = ACE_OS::gethrtime (); 00059 ACE_High_Res_Timer::hrtime_to_tv (this->interval_end_, 00060 hrtime_now); 00061 00062 u_long & count = enqueue_count_ [this->supplier_index_][i]; 00063 ++count; 00064 } 00065 00066 } |
|
Definition at line 71 of file Metrics_Cache_T.inl. References ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::enqueue_count_, ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::enqueue_probes_, ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::probe_set_size_, and ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::supplier_index_.
00072 { 00073 if (i < this->probe_set_size_) 00074 { 00075 ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> * probe = 00076 this->enqueue_probes_ [this->supplier_index_][i]; 00077 probe-> 00078 timeprobe (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_SUSPEND); 00079 u_long & count = 00080 this->enqueue_count_ [this->supplier_index_] [i]; 00081 ++count; 00082 } 00083 } |
|
|
Definition at line 220 of file Metrics_Cache_T.h. |
|
Definition at line 195 of file Metrics_Cache_T.h. Referenced by ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::flip_supplier_and_consumer(), and ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::reset_base_statistics(). |
|
|
Definition at line 191 of file Metrics_Cache_T.h. |
|
|
|
Definition at line 190 of file Metrics_Cache_T.h. |
|
|
|
|
|
Definition at line 215 of file Metrics_Cache_T.h. Referenced by ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::metrics_enabled(). |
|
|
|
Definition at line 202 of file Metrics_Cache_T.h. |