1
#pragma once
2

            
3
#include "envoy/buffer/buffer.h"
4
#include "envoy/http/codes.h"
5
#include "envoy/http/header_map.h"
6
#include "envoy/server/admin.h"
7

            
8
#include "absl/strings/string_view.h"
9

            
10
namespace Envoy {
11
namespace Server {
12

            
13
class ProfilingHandler {
14

            
15
public:
16
  ProfilingHandler(const std::string& profile_path);
17

            
18
  Http::Code handlerCpuProfiler(Http::ResponseHeaderMap& response_headers,
19
                                Buffer::Instance& response, AdminStream&);
20

            
21
  Http::Code handlerHeapProfiler(Http::ResponseHeaderMap& response_headers,
22
                                 Buffer::Instance& response, AdminStream&);
23

            
24
private:
25
  const std::string profile_path_;
26
};
27

            
28
class TcmallocProfilingHandler {
29
public:
30
  TcmallocProfilingHandler() = default;
31

            
32
  Http::Code handlerHeapDump(Http::ResponseHeaderMap& response_headers, Buffer::Instance& response,
33
                             AdminStream&);
34

            
35
  Http::Code handlerAllocationProfiler(Http::ResponseHeaderMap& response_headers,
36
                                       Buffer::Instance& response, AdminStream&);
37
};
38

            
39
} // namespace Server
40
} // namespace Envoy