diff options
Diffstat (limited to 'TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp')
-rw-r--r-- | TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp index 03cea69d4f8..5802b7ce7e3 100644 --- a/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp +++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp @@ -101,19 +101,25 @@ Test_Consumer::disconnect (CORBA::Environment &ACE_TRY_ENV) } void -Test_Consumer::dump_results (const char* name, - ACE_UINT32 gsf) +Test_Consumer::dump_results (const char* name) { - this->throughput_.dump_results (name, gsf); + this->throughput_.dump_results ("ECT_Consumers", name); + this->latency_.dump_results ("ECT_Consumers", name); } void -Test_Consumer::accumulate (ACE_Throughput_Stats& stats) const +Test_Consumer::accumulate (ECT_Driver::Throughput_Stats& stats) const { stats.accumulate (this->throughput_); } void +Test_Consumer::accumulate (ECT_Driver::Latency_Stats& stats) const +{ + stats.accumulate (this->latency_); +} + +void Test_Consumer::push (const RtecEventComm::EventSet& events, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) @@ -129,7 +135,9 @@ Test_Consumer::push (const RtecEventComm::EventSet& events, // We start the timer as soon as we receive the first event... if (this->recv_count_ == 0) - this->first_event_ = ACE_OS::gethrtime (); + this->throughput_.start (); + + this->throughput_.sample (); this->recv_count_ += events.length (); @@ -154,6 +162,7 @@ Test_Consumer::push (const RtecEventComm::EventSet& events, { // We stop the timer as soon as we realize it is time to // do so. + this->throughput_.stop (); this->driver_->shutdown_consumer (this->cookie_, ACE_TRY_ENV); ACE_CHECK; } @@ -165,8 +174,8 @@ Test_Consumer::push (const RtecEventComm::EventSet& events, e.header.creation_time); const ACE_hrtime_t now = ACE_OS::gethrtime (); - this->throughput_.sample (now - this->first_event_, - now - creation); + const ACE_hrtime_t elapsed = now - creation; + this->latency_.sample (elapsed); } } } |