forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server_stats.h
60 lines (49 loc) · 1.73 KB
/
server_stats.h
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
#pragma once
#include "envoy/stats/stats.h"
namespace Envoy {
// Abstract interface for IntegrationTestServer stats methods.
class IntegrationTestServerStats {
public:
virtual ~IntegrationTestServerStats() {}
/**
* Wait for a counter to >= a given value.
* @param name counter name.
* @param value target value.
*/
virtual void waitForCounterGe(const std::string& name, uint64_t value) PURE;
/**
* Wait for a gauge to >= a given value.
* @param name gauge name.
* @param value target value.
*/
virtual void waitForGaugeGe(const std::string& name, uint64_t value) PURE;
/**
* Wait for a gauge to == a given value.
* @param name gauge name.
* @param value target value.
*/
virtual void waitForGaugeEq(const std::string& name, uint64_t value) PURE;
/**
* Counter lookup. This is not thread safe, since we don't get a consistent
* snapshot, uses counters() instead for this behavior.
* @param name counter name.
* @return Stats::CounterSharedPtr counter if it exists, otherwise nullptr.
*/
virtual Stats::CounterSharedPtr counter(const std::string& name) PURE;
/**
* Gauge lookup. This is not thread safe, since we don't get a consistent
* snapshot, uses gauges() instead for this behavior.
* @param name gauge name.
* @return Stats::GaugeSharedPtr gauge if it exists, otherwise nullptr.
*/
virtual Stats::GaugeSharedPtr gauge(const std::string& name) PURE;
/**
* @return std::list<Stats::CounterSharedPtr> snapshot of server counters.
*/
virtual std::list<Stats::CounterSharedPtr> counters() PURE;
/**
* @return std::list<Stats::GaugeSharedPtr> snapshot of server counters.
*/
virtual std::list<Stats::GaugeSharedPtr> gauges() PURE;
};
} // namespace Envoy