1
#pragma once
2

            
3
#include "envoy/grpc/status.h"
4

            
5
#include "source/common/stats/symbol_table.h"
6

            
7
#include "absl/container/flat_hash_map.h"
8

            
9
namespace Envoy {
10
namespace Grpc {
11

            
12
/**
13
 * Captures symbolized representation for tokens used in grpc stats. These are
14
 * broken out so they can be allocated early and used across all gRPC-related
15
 * filters.
16
 */
17
struct StatNames {
18
  explicit StatNames(Stats::SymbolTable& symbol_table);
19

            
20
  Stats::StatNamePool pool_;
21
  Stats::StatName streams_total_;
22
  std::array<Stats::StatName, Status::WellKnownGrpcStatus::MaximumKnown + 1> streams_closed_;
23
  absl::flat_hash_map<std::string, Stats::StatName> status_names_;
24
  // Stat name tracking the creation of the Google grpc client.
25
  Stats::StatName google_grpc_client_creation_;
26
};
27

            
28
} // namespace Grpc
29
} // namespace Envoy