diff options
Diffstat (limited to 'TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp')
-rw-r--r-- | TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp index 235306bb1ca..946d4cde39a 100644 --- a/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp +++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp @@ -103,20 +103,20 @@ Test_Consumer::disconnect (CORBA::Environment &TAO_IN_ENV) void Test_Consumer::dump_results (const char* name) { - this->throughput_.dump_results ("ECT_Consumers", name); - this->latency_.dump_results ("ECT_Consumers", name); -} - -void -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_); + ACE_Time_Value tv; + this->timer_.elapsed_time (tv); + double f = 1.0 / (tv.sec () + tv.usec () / 1000000.0); + double eps = this->recv_count_ * f; + + ACE_DEBUG ((LM_DEBUG, + "ECT_Consumer (%s):\n" + " Total time: %d.%08.8d (secs.usecs)\n" + " Total events: %d\n" + " Events per second: %.3f\n", + name, + tv.sec (), tv.usec (), + this->recv_count_, + eps)); } void @@ -125,8 +125,7 @@ Test_Consumer::push (const RtecEventComm::EventSet& events, { if (events.length () == 0) { - ACE_DEBUG ((LM_DEBUG, - "ECT_Consumer (%P|%t) no events\n")); + // ACE_DEBUG ((LM_DEBUG, "no events\n")); return; } @@ -134,18 +133,16 @@ 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->throughput_.start (); - - this->throughput_.sample (); + this->timer_.start (); this->recv_count_ += events.length (); if (TAO_debug_level > 0 - && this->recv_count_ % 100 == 0) + && this->recv_count_ % 1000 == 0) { ACE_DEBUG ((LM_DEBUG, "ECT_Consumer (%P|%t): %d events received\n", - this->recv_count_)); + this->recv_count_)); } // ACE_DEBUG ((LM_DEBUG, "%d event(s)\n", events.length ())); @@ -161,7 +158,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->timer_.stop (); this->driver_->shutdown_consumer (this->cookie_, TAO_IN_ENV); } } @@ -171,9 +168,20 @@ Test_Consumer::push (const RtecEventComm::EventSet& events, ORBSVCS_Time::TimeT_to_hrtime (creation, e.header.creation_time); + ACE_hrtime_t ec_recv; + ORBSVCS_Time::TimeT_to_hrtime (ec_recv, + e.header.ec_recv_time); + + ACE_hrtime_t ec_send; + ORBSVCS_Time::TimeT_to_hrtime (ec_send, + e.header.ec_send_time); + const ACE_hrtime_t now = ACE_OS::gethrtime (); const ACE_hrtime_t elapsed = now - creation; - this->latency_.sample (elapsed); + this->driver_->end_to_end (elapsed); + this->driver_->supplier_to_ec (ec_recv - creation); + this->driver_->inside_ec (ec_send - ec_recv); + this->driver_->ec_to_consumer (now - ec_send); } } } |