admin: add /memory for inspection of heap usage (#4361)

Adds a /memory endpoint to the admin panel for fast inspection of Envoy::Memory's heap statistics, without needing to query stats.

Risk Level: Low
Testing: Added a test to admin_test.cc.
Docs Changes: Added a description of the option to admin.rst.
Release Notes: N/A

Signed-off-by: James Buckland <jbuckland@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ b5ba7f89a4433d283549c61a659c4e61ed564d16
pull/620/head
data-plane-api(CircleCI) 7 years ago
parent e19a09b8f8
commit d962d78e04
  1. 6
      envoy/admin/v2alpha/BUILD
  2. 19
      envoy/admin/v2alpha/memory.proto

@ -31,3 +31,9 @@ api_proto_library_internal(
srcs = ["metrics.proto"],
visibility = ["//visibility:public"],
)
api_proto_library_internal(
name = "memory",
srcs = ["memory.proto"],
visibility = ["//visibility:public"],
)

@ -0,0 +1,19 @@
syntax = "proto3";
package envoy.admin.v2alpha;
// [#protodoc-title: Memory]
// Proto representation of the internal memory consumption of an Envoy instance. These represent
// values extracted from an internal TCMalloc instance. For more information, see the section of the
// docs entitled ["Generic Tcmalloc Status"](http://gperftools.github.io/gperftools/tcmalloc.html).
message Memory {
// The number of bytes allocated by the heap for Envoy. This is an alias for
// `generic.current_allocated_bytes`.
uint64 allocated = 1;
// The number of bytes reserved by the heap but not necessarily allocated. This is an alias for
// `generic.heap_size`.
uint64 heap_size = 2;
}
Loading…
Cancel
Save