summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/EC_Throughput/ECT_Driver.i
blob: c4481a2da3dadce84b10f122bbea316f003b52b2 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//
// $Id$
//

ACE_INLINE
ECT_Driver::Latency_Stats::Latency_Stats (void)
  :  n_ (0),
     sum_ (0),
     sum2_ (0),
     min_ (0),
     max_ (0)
{
}

ACE_INLINE
void ECT_Driver::Latency_Stats::sample (ACE_hrtime_t sample)
{
  this->sum_ += sample;
  this->sum2_ += sample * sample;
  if (this->n_ == 0)
    {
      this->min_ = sample;
      this->max_ = sample;
    }
  else if (this->min_ > sample)
    this->min_ = sample;
  else if (this->max_ < sample)
    this->max_ = sample;
  this->n_++;
}

// ****************************************************************

ACE_INLINE void
ECT_Driver::Throughput_Stats::start (void)
{
  this->done_ = 0;
  this->start_ = ACE_OS::gethrtime ();
}

ACE_INLINE void
ECT_Driver::Throughput_Stats::stop (void)
{
  this->done_ = 1;
  this->stop_ = ACE_OS::gethrtime ();
}

ACE_INLINE void
ECT_Driver::Throughput_Stats::sample (void)
{
  this->n_++;
}

// ****************************************************************

ACE_INLINE
void ECT_Driver::end_to_end (ACE_hrtime_t sample)
{
  this->end_to_end_.sample (sample);
}

ACE_INLINE
void ECT_Driver::supplier_to_ec (ACE_hrtime_t sample)
{
  this->supplier_to_ec_.sample (sample);
}

ACE_INLINE
void ECT_Driver::inside_ec (ACE_hrtime_t sample)
{
  this->inside_ec_.sample (sample);
}

ACE_INLINE
void ECT_Driver::ec_to_consumer (ACE_hrtime_t sample)
{
  this->ec_to_consumer_.sample (sample);
}