Coverage Report

Created: 2023-11-12 09:30

/proc/self/cwd/source/extensions/filters/network/thrift_proxy/stats.h
Line
Count
Source (jump to first uncovered line)
1
#pragma once
2
3
#include <string>
4
5
#include "envoy/stats/scope.h"
6
#include "envoy/stats/stats_macros.h"
7
8
namespace Envoy {
9
namespace Extensions {
10
namespace NetworkFilters {
11
namespace ThriftProxy {
12
13
/**
14
 * All thrift filter stats. @see stats_macros.h
15
 */
16
#define ALL_THRIFT_FILTER_STATS(COUNTER, GAUGE, HISTOGRAM)                                         \
17
0
  COUNTER(cx_destroy_local_with_active_rq)                                                         \
18
0
  COUNTER(cx_destroy_remote_with_active_rq)                                                        \
19
0
  COUNTER(downstream_cx_max_requests)                                                              \
20
0
  COUNTER(downstream_response_drain_close)                                                         \
21
0
  COUNTER(request)                                                                                 \
22
0
  COUNTER(request_call)                                                                            \
23
0
  COUNTER(request_decoding_error)                                                                  \
24
0
  COUNTER(request_invalid_type)                                                                    \
25
0
  COUNTER(request_oneway)                                                                          \
26
0
  COUNTER(request_passthrough)                                                                     \
27
0
  COUNTER(request_internal_error)                                                                  \
28
0
  COUNTER(response)                                                                                \
29
0
  COUNTER(response_decoding_error)                                                                 \
30
0
  COUNTER(response_error)                                                                          \
31
0
  COUNTER(response_exception)                                                                      \
32
0
  COUNTER(response_invalid_type)                                                                   \
33
0
  COUNTER(response_passthrough)                                                                    \
34
0
  COUNTER(response_reply)                                                                          \
35
0
  COUNTER(response_success)                                                                        \
36
0
  GAUGE(request_active, Accumulate)                                                                \
37
0
  HISTOGRAM(request_time_ms, Milliseconds)
38
39
/**
40
 * Struct definition for all thrift proxy stats. @see stats_macros.h
41
 */
42
struct ThriftFilterStats {
43
  ALL_THRIFT_FILTER_STATS(GENERATE_COUNTER_STRUCT, GENERATE_GAUGE_STRUCT, GENERATE_HISTOGRAM_STRUCT)
44
45
0
  static ThriftFilterStats generateStats(const std::string& prefix, Stats::Scope& scope) {
46
0
    return ThriftFilterStats{ALL_THRIFT_FILTER_STATS(POOL_COUNTER_PREFIX(scope, prefix),
47
0
                                                     POOL_GAUGE_PREFIX(scope, prefix),
48
0
                                                     POOL_HISTOGRAM_PREFIX(scope, prefix))};
49
0
  }
50
};
51
52
} // namespace ThriftProxy
53
} // namespace NetworkFilters
54
} // namespace Extensions
55
} // namespace Envoy