1 #include "ace/Log_Msg.h"
4 Task_Stats::sample (ACE_UINT64 inv_start_time, ACE_UINT64 inv_end_time)
6 if (this->samples_count_ >= this->max_samples_)
8 ACE_DEBUG ((LM_DEBUG, "Task_Stats::sample ret -1\n"));
11 ACE_UINT64 inv_value, exec_value;
13 inv_value = inv_start_time - base_time_;
14 exec_value = inv_end_time - inv_start_time;
16 this->time_inv_[this->samples_count_] = inv_value;
17 this->time_exec_[this->samples_count_] = exec_value;
19 this->samples_count_++;
21 if (this->samples_count_ == 1u)
23 this->exec_time_min_ = exec_value;
24 this->exec_time_min_at_ = this->samples_count_;
25 this->exec_time_max_ = exec_value;
26 this->exec_time_max_at_ = this->samples_count_;
27 this->sum_ = exec_value;
28 this->sum2_ = exec_value * exec_value;
32 if (this->exec_time_min_ > exec_value)
34 this->exec_time_min_ = exec_value;
35 this->exec_time_min_at_ = this->samples_count_;
37 if (this->exec_time_max_ < exec_value)
39 this->exec_time_max_ = exec_value;
40 this->exec_time_max_at_ = this->samples_count_;
43 this->sum_ += exec_value;
44 this->sum2_ += exec_value * exec_value;