forked from Abc-Arbitrage/Disruptor-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLatencyRecorder.h
More file actions
48 lines (37 loc) · 1.1 KB
/
Copy pathLatencyRecorder.h
File metadata and controls
48 lines (37 loc) · 1.1 KB
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
#pragma once
#include <cstdint>
#include "Disruptor/Pragmas.h"
DISRUPTOR_PRAGMA_PUSH
DISRUPTOR_PRAGMA_IGNORE_ALL
DISRUPTOR_PRAGMA_IGNORE_UNREACHABLE_CODE
DISRUPTOR_PRAGMA_IGNORE_DEPRECATED_DECLARATIONS
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics.hpp>
DISRUPTOR_PRAGMA_POP
namespace Disruptor
{
namespace Tests
{
class LatencyRecorder
{
using Accumulator = boost::accumulators::accumulator_set
<
double,
boost::accumulators::stats
<
boost::accumulators::tag::mean,
boost::accumulators::tag::max,
boost::accumulators::tag::min,
boost::accumulators::tag::variance,
boost::accumulators::tag::tail_quantile< boost::accumulators::right >
>
>;
public:
explicit LatencyRecorder(std::int64_t sampleSize);
void record(std::int64_t value);
void writeReport(std::ostream& stream) const;
private:
Accumulator m_accumulator;
};
} // namespace Tests
} // namespace Disruptor