diff options
author | pradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-03 20:36:20 +0000 |
---|---|---|
committer | pradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-03 20:36:20 +0000 |
commit | 2c623a4f9475e3896439543c052a2aeaaffafec3 (patch) | |
tree | 6cbcef5dd9666d0aa1c6c1639b54b956644440a0 /TAO/orbsvcs/tests/Notify/lib/Task_Stats.inl | |
parent | 2d534874522c5ec20a720560e1be45444acb1b93 (diff) | |
download | ATCD-2c623a4f9475e3896439543c052a2aeaaffafec3.tar.gz |
ChangeLogTag: Thu Apr 03 13:31:17 2003 Pradeep Gore <pradeep@oomworks.com>
Diffstat (limited to 'TAO/orbsvcs/tests/Notify/lib/Task_Stats.inl')
-rw-r--r-- | TAO/orbsvcs/tests/Notify/lib/Task_Stats.inl | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/TAO/orbsvcs/tests/Notify/lib/Task_Stats.inl b/TAO/orbsvcs/tests/Notify/lib/Task_Stats.inl new file mode 100644 index 00000000000..0e9aa2b2bb7 --- /dev/null +++ b/TAO/orbsvcs/tests/Notify/lib/Task_Stats.inl @@ -0,0 +1,55 @@ +//$Id$ + +ACE_INLINE int +Task_Stats::sample (ACE_UINT64 inv_start_time, ACE_UINT64 inv_end_time) +{ + if (this->samples_count_ >= this->max_samples_) + { + ACE_DEBUG ((LM_DEBUG, "Task_Stats::sample ret -1\n")); + return -1; + } + ACE_UINT64 inv_value, exec_value; + + inv_value = inv_start_time - base_time_; + exec_value = inv_end_time - inv_start_time; + + this->time_inv_[this->samples_count_] = inv_value; + this->time_exec_[this->samples_count_] = exec_value; + + this->samples_count_++; + + if (this->samples_count_ == 1u) + { + this->exec_time_min_ = exec_value; + this->exec_time_min_at_ = this->samples_count_; + this->exec_time_max_ = exec_value; + this->exec_time_max_at_ = this->samples_count_; + this->sum_ = exec_value; +#if defined ACE_LACKS_LONGLONG_T + this->sum2_ = exec_value * ACE_U64_TO_U32 (exec_value); +#else /* ! ACE_LACKS_LONGLONG_T */ + this->sum2_ = exec_value * exec_value; +#endif /* ! ACE_LACKS_LONGLONG_T */ + } + else + { + if (this->exec_time_min_ > exec_value) + { + this->exec_time_min_ = exec_value; + this->exec_time_min_at_ = this->samples_count_; + } + if (this->exec_time_max_ < exec_value) + { + this->exec_time_max_ = exec_value; + this->exec_time_max_at_ = this->samples_count_; + } + + this->sum_ += exec_value; +#if defined ACE_LACKS_LONGLONG_T + this->sum2_ += exec_value * ACE_U64_TO_U32 (exec_value); +#else /* ! ACE_LACKS_LONGLONG_T */ + this->sum2_ += exec_value * exec_value; +#endif /* ! ACE_LACKS_LONGLONG_T */ + } + return 0; +} |