summaryrefslogtreecommitdiff
path: root/ace/Metrics_Cache_T.inl
diff options
context:
space:
mode:
Diffstat (limited to 'ace/Metrics_Cache_T.inl')
-rw-r--r--ace/Metrics_Cache_T.inl60
1 files changed, 27 insertions, 33 deletions
diff --git a/ace/Metrics_Cache_T.inl b/ace/Metrics_Cache_T.inl
index e0f542ab366..6d48c917059 100644
--- a/ace/Metrics_Cache_T.inl
+++ b/ace/Metrics_Cache_T.inl
@@ -1,11 +1,7 @@
-// -*- C++ -*-
-//
// $Id$
-
-#ifndef ACE_METRICS_CACHE_T_INL
-#define ACE_METRICS_CACHE_T_INL
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+\
+#ifndef METRICS_CACHE_T_I
+#define METRICS_CACHE_T_I
/////////////////////////////
// Class ACE_Metrics_Cache //
@@ -18,8 +14,8 @@ ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::report_enqueue_start (u_long i)
{
if (i < this->probe_set_size_)
{
- u_long & count =
- this->enqueue_count_ [this->supplier_index_] [i];
+ u_long & count =
+ this->enqueue_count_ [this->supplier_index_] [i];
++count;
if (! this->interval_initialized_)
@@ -27,15 +23,15 @@ ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::report_enqueue_start (u_long i)
this->interval_initialized_ = 1;
ACE_hrtime_t hrtime_now = ACE_OS::gethrtime ();
ACE_High_Res_Timer::hrtime_to_tv (this->interval_start_,
- hrtime_now);
+ hrtime_now);
this->interval_end_.set (this->interval_start_.sec(),
this->interval_start_.usec());
}
-
+
// Take the metrics timeprobe last, to avoid measuring the above
// metrics processing.
ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> * probe =
- this->enqueue_probes_ [this->supplier_index_][i];
+ this->enqueue_probes_ [this->supplier_index_][i];
probe->
timeprobe (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_START);
}
@@ -51,13 +47,13 @@ ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::report_enqueue_stop (u_long i)
// Take the metrics timeprobe first, to avoid measuring the below
// metrics processing.
ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> * probe =
- this->enqueue_probes_ [this->supplier_index_][i];
+ this->enqueue_probes_ [this->supplier_index_][i];
probe->
timeprobe (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_STOP);
ACE_hrtime_t hrtime_now = ACE_OS::gethrtime ();
ACE_High_Res_Timer::hrtime_to_tv (this->interval_end_,
- hrtime_now);
+ hrtime_now);
u_long & count = enqueue_count_ [this->supplier_index_][i];
++count;
@@ -75,8 +71,8 @@ ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::report_enqueue_suspend (u_long i)
ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> * probe =
this->enqueue_probes_ [this->supplier_index_][i];
probe->
- timeprobe (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_SUSPEND);
- u_long & count =
+ timeprobe (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_SUSPEND);
+ u_long & count =
this->enqueue_count_ [this->supplier_index_] [i];
++count;
}
@@ -89,11 +85,11 @@ ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::report_enqueue_resume (u_long i)
{
if (i < this->probe_set_size_)
{
- u_long & count =
- this->enqueue_count_ [this->supplier_index_] [i];
+ u_long & count =
+ this->enqueue_count_ [this->supplier_index_] [i];
++count;
ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> * probe =
- this->enqueue_probes_ [this->supplier_index_][i];
+ this->enqueue_probes_ [this->supplier_index_][i];
probe->
timeprobe (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_RESUME);
}
@@ -107,7 +103,7 @@ ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::report_dequeue_start (u_long i)
if (i < this->probe_set_size_)
{
u_long & count =
- this->dequeue_count_ [this->supplier_index_] [i];
+ this->dequeue_count_ [this->supplier_index_] [i];
++count;
if (! this->interval_initialized_)
@@ -115,7 +111,7 @@ ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::report_dequeue_start (u_long i)
this->interval_initialized_ = 1;
ACE_hrtime_t hrtime_now = ACE_OS::gethrtime ();
ACE_High_Res_Timer::hrtime_to_tv (this->interval_start_,
- hrtime_now);
+ hrtime_now);
this->interval_end_.set (this->interval_start_.sec(),
this->interval_start_.usec());
}
@@ -140,12 +136,12 @@ ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::report_dequeue_stop (u_long i)
// metrics processing below.
ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> * probe =
this->dequeue_probes_ [this->supplier_index_][i];
-
+
probe->timeprobe (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_STOP);
ACE_hrtime_t hrtime_now = ACE_OS::gethrtime ();
ACE_High_Res_Timer::hrtime_to_tv (this->interval_end_,
- hrtime_now);
+ hrtime_now);
u_long & count = dequeue_count_ [this->supplier_index_] [i];
++count;
@@ -160,7 +156,7 @@ ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::report_dequeue_suspend (u_long i)
if (i < this->probe_set_size_)
{
u_long & count =
- this->dequeue_count_ [this->supplier_index_] [i];
+ this->dequeue_count_ [this->supplier_index_] [i];
++count;
ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> * probe =
this->dequeue_probes_ [this->supplier_index_][i];
@@ -176,8 +172,8 @@ ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::report_dequeue_resume (u_long i)
{
if (i < this->probe_set_size_)
{
- u_long & count =
- this->dequeue_count_ [this->supplier_index_] [i];
+ u_long & count =
+ this->dequeue_count_ [this->supplier_index_] [i];
++count;
ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> * probe =
this->dequeue_probes_ [this->supplier_index_][i];
@@ -188,7 +184,7 @@ ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::report_dequeue_resume (u_long i)
template <class ACE_LOCK, class ALLOCATOR>
-ACE_INLINE void
+ACE_INLINE void
ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::reset_base_statistics ()
{
this->interval_initialized_ = 0;
@@ -204,7 +200,7 @@ ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::reset_base_statistics ()
this->enqueue_probes_ [this->consumer_index_][i];
probe->reset ();
probe =
- this->dequeue_probes_ [this->consumer_index_][i];
+ this->dequeue_probes_ [this->consumer_index_][i];
probe->reset ();
}
}
@@ -222,19 +218,17 @@ ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::flip_supplier_and_consumer ()
}
template <class ACE_LOCK, class ALLOCATOR>
-ACE_INLINE void
+ACE_INLINE void
ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::metrics_enabled(int enabled)
{
metrics_enabled_ = enabled;
}
template <class ACE_LOCK, class ALLOCATOR>
-ACE_INLINE int
+ACE_INLINE int
ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::metrics_enabled(void) const
{
return metrics_enabled_;
}
-ACE_END_VERSIONED_NAMESPACE_DECL
-
-#endif /* ACE_METRICS_CACHE_T_INL */
+#endif /* METRICS_CACHE_T_I */