blob: e27a75f3a6e15402347c03dd56e49e53f3b5581d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
ACE_INLINE
Receiver_Stats::Receiver_Stats ()
: samples_count_ (0)
, min_ (0)
, min_at_ (0)
, max_ (0)
, max_at_ (0)
, sum_ (0)
, sum2_ (0)
{
}
ACE_INLINE ACE_UINT32
Receiver_Stats::samples_count () const
{
return this->samples_count_;
}
ACE_INLINE void
Receiver_Stats::sample (ACE_UINT64 value)
{
++this->samples_count_;
if (this->samples_count_ == 1u)
{
this->min_ = value;
this->min_at_ = this->samples_count_;
this->max_ = value;
this->max_at_ = this->samples_count_;
this->sum_ = value;
this->sum2_ = value * value;
}
else
{
if (this->min_ > value)
{
this->min_ = value;
this->min_at_ = this->samples_count_;
}
if (this->max_ < value)
{
this->max_ = value;
this->max_at_ = this->samples_count_;
}
this->sum_ += value;
this->sum2_ += value * value;
}
}
|