1
#pragma once
2

            
3
#include <memory>
4

            
5
#include "envoy/stats/stats_macros.h"
6

            
7
namespace Envoy {
8
namespace Upstream {
9

            
10
/**
11
 * All load reporter stats. @see stats_macros.h
12
 */
13
#define ALL_LOAD_REPORTER_STATS(COUNTER)                                                           \
14
41
  COUNTER(requests)                                                                                \
15
41
  COUNTER(responses)                                                                               \
16
41
  COUNTER(errors)                                                                                  \
17
41
  COUNTER(retries)
18

            
19
/**
20
 * Struct definition for all load reporter stats. @see stats_macros.h
21
 */
22
struct LoadReporterStats {
23
  ALL_LOAD_REPORTER_STATS(GENERATE_COUNTER_STRUCT)
24
};
25

            
26
/**
27
 * Interface for load stats reporting.
28
 */
29
class LoadStatsReporter {
30
public:
31
41
  virtual ~LoadStatsReporter() = default;
32

            
33
  /**
34
   * @return the load reporter stats.
35
   */
36
  virtual const LoadReporterStats& getStats() const PURE;
37
};
38

            
39
using LoadStatsReporterPtr = std::unique_ptr<LoadStatsReporter>;
40

            
41
} // namespace Upstream
42
} // namespace Envoy