summaryrefslogtreecommitdiff
path: root/TAO/tests/Portable_Interceptors/Benchmark/marker.cpp
blob: 1f4be34e3e78d1fe9cd4e76ea2173fa76159f0e3 (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
// $Id$
#include "marker.h"

void
Marker::accumulate_into (ACE_Throughput_Stats &throughput,
                         int which_method) const
{
  switch (which_method)
    {
    case 1: // method ready
      throughput.accumulate (this->throughput_method_ready_);
      break;
    case 2: // method authenticate
      throughput.accumulate (this->throughput_method_authenticate_);
      break;
    case 3: // method update_records
      throughput.accumulate (this->throughput_method_update_records_);
      break;
    default:
      break; 
    }
  
}

void
Marker::dump_stats (const char* msg, 
                    ACE_UINT32 gsf,
                    int which_method)
{
  switch (which_method)
    {
    case 1: // method ready
      this->throughput_method_ready_.dump_results (ACE_TEXT_TO_TCHAR_IN(msg), gsf);
      break;
    case 2: // method authentciate
      this->throughput_method_authenticate_.dump_results (ACE_TEXT_TO_TCHAR_IN(msg), gsf);
      break;
    case 3: // method update_records
      this->throughput_method_update_records_.dump_results (ACE_TEXT_TO_TCHAR_IN(msg), gsf);
      break;
    default:
      break;
    }
}

void
Marker::sample (ACE_hrtime_t throughput_diff,
                ACE_hrtime_t latency_diff,
                int which_method)
{
  switch (which_method)
    {
    case 1: // method ready
      this->throughput_method_ready_.sample (throughput_diff, 
                                             latency_diff);
      break;
    case 2: // method authentciate
      this->throughput_method_authenticate_.sample (throughput_diff, 
                                                    latency_diff);
      break;
    case 3: // method update_records
      this->throughput_method_update_records_.sample (throughput_diff, 
                                                      latency_diff);
      break;
    default:
      break;
    }

}