diff options
Diffstat (limited to 'TAO/orbsvcs/tests/Event/lib/Consumer.cpp')
-rw-r--r-- | TAO/orbsvcs/tests/Event/lib/Consumer.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/TAO/orbsvcs/tests/Event/lib/Consumer.cpp b/TAO/orbsvcs/tests/Event/lib/Consumer.cpp index 91488dba4fe..0622ed6eb4e 100644 --- a/TAO/orbsvcs/tests/Event/lib/Consumer.cpp +++ b/TAO/orbsvcs/tests/Event/lib/Consumer.cpp @@ -89,16 +89,18 @@ EC_Consumer::shutdown (CORBA::Environment &ACE_TRY_ENV) } void -EC_Consumer::dump_results (const char* name, - ACE_UINT32 gsf) +EC_Consumer::dump_results (const char* name) { - this->throughput_.dump_results (name, gsf); + this->throughput_.dump_results ("EC_Consumers", name); + this->latency_.dump_results ("EC_Consumers", name); } void -EC_Consumer::accumulate (ACE_Throughput_Stats& throughput) const +EC_Consumer::accumulate (EC_Driver::Throughput_Stats& throughput, + EC_Driver::Latency_Stats& latency) const { throughput.accumulate (this->throughput_); + latency.accumulate (this->latency_); } void @@ -117,7 +119,10 @@ EC_Consumer::push (const RtecEventComm::EventSet& events, ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->lock_); if (this->push_count_ == 0) - this->throughput_start_ = ACE_OS::gethrtime (); + this->throughput_.start (); + + // We start the timer as soon as we receive the first event... + this->throughput_.sample (); this->push_count_ += events.length (); @@ -138,8 +143,8 @@ EC_Consumer::push (const RtecEventComm::EventSet& events, e.header.creation_time); const ACE_hrtime_t now = ACE_OS::gethrtime (); - this->throughput_.sample (now - this->throughput_start_, - now - creation); + const ACE_hrtime_t elapsed = now - creation; + this->latency_.sample (elapsed); if (e.header.type == this->shutdown_event_type_) this->driver_->consumer_shutdown (this->cookie_, ACE_TRY_ENV); |