]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/ext/include/opentelemetry/ext/zpages/latency_boundaries.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / ext / include / opentelemetry / ext / zpages / latency_boundaries.h
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3
4 #pragma once
5
6 #include <array>
7 #include <chrono>
8
9 #include "opentelemetry/version.h"
10
11 using std::chrono::microseconds;
12 using std::chrono::milliseconds;
13 using std::chrono::nanoseconds;
14 using std::chrono::seconds;
15
16 OPENTELEMETRY_BEGIN_NAMESPACE
17 namespace ext
18 {
19 namespace zpages
20 {
21 /**
22 * kLatencyBoundaries is a constant array that contains the 9 latency
23 * boundaries. Each value in the array represents the lower limit(inclusive) of
24 * the boundary(in nano seconds) and the upper limit(exclusive) of the boundary
25 * is the lower limit of the next one. The upper limit of the last boundary is
26 * INF.
27 */
28 const std::array<nanoseconds, 9> kLatencyBoundaries = {
29 nanoseconds(0),
30 nanoseconds(microseconds(10)),
31 nanoseconds(microseconds(100)),
32 nanoseconds(milliseconds(1)),
33 nanoseconds(milliseconds(10)),
34 nanoseconds(milliseconds(100)),
35 nanoseconds(seconds(1)),
36 nanoseconds(seconds(10)),
37 nanoseconds(seconds(100)),
38 };
39
40 /**
41 * LatencyBoundary enum is used to index into the kLatencyBoundaries container.
42 * Using this enum lets you access the latency boundary at each index without
43 * using magic numbers
44 */
45 enum LatencyBoundary
46 {
47 k0MicroTo10Micro,
48 k10MicroTo100Micro,
49 k100MicroTo1Milli,
50 k1MilliTo10Milli,
51 k10MilliTo100Milli,
52 k100MilliTo1Second,
53 k1SecondTo10Second,
54 k10SecondTo100Second,
55 k100SecondToMax
56 };
57
58 } // namespace zpages
59 } // namespace ext
60 OPENTELEMETRY_END_NAMESPACE