1
#pragma once
2

            
3
#include "envoy/http/context.h"
4

            
5
#include "source/common/http/codes.h"
6
#include "source/common/http/user_agent.h"
7

            
8
namespace Envoy {
9
namespace Http {
10

            
11
/**
12
 * Captures http-related structures with cardinality of one per server.
13
 */
14
class ContextImpl : public Context {
15
public:
16
  explicit ContextImpl(Stats::SymbolTable& symbol_table);
17
51401
  ~ContextImpl() override = default;
18

            
19
15
  const envoy::config::trace::v3::Tracing& defaultTracingConfig() override {
20
15
    return default_tracing_config_;
21
15
  }
22

            
23
77297
  CodeStats& codeStats() override { return code_stats_; }
24

            
25
10826
  void setDefaultTracingConfig(const envoy::config::trace::v3::Tracing& tracing_config) {
26
10826
    default_tracing_config_ = tracing_config;
27
10826
  }
28

            
29
22431
  const UserAgentContext& userAgentContext() const override { return user_agent_context_; }
30
15221
  const Stats::StatName& asyncClientStatPrefix() const override {
31
15221
    return async_client_stat_prefix_;
32
15221
  }
33

            
34
private:
35
  CodeStatsImpl code_stats_;
36
  UserAgentContext user_agent_context_;
37
  const Stats::StatName async_client_stat_prefix_;
38
  envoy::config::trace::v3::Tracing default_tracing_config_;
39
};
40

            
41
} // namespace Http
42
} // namespace Envoy