MCPcopy Create free account
hub / github.com/apache/mesos / statistics

Method statistics

3rdparty/libprocess/src/memory_profiler.cpp:935–955  ·  view source on GitHub ↗

TODO(bevers): Allow passing custom options via query parameters.

Source from the content-addressed store, hash-verified

933
934// TODO(bevers): Allow passing custom options via query parameters.
935Future<http::Response> MemoryProfiler::statistics(
936 const http::Request& request,
937 const Option<http::authentication::Principal>&)
938{
939 if (!detectJemalloc()) {
940 return http::BadRequest(string(JEMALLOC_NOT_DETECTED_MESSAGE) + ".\n");
941 }
942
943 const string options = "J"; // 'J' selects JSON output format.
944
945 string statistics;
946
947#ifdef LIBPROCESS_ALLOW_JEMALLOC
948 ::malloc_stats_print([](void* opaque, const char* msg) {
949 string* statistics = static_cast<string*>(opaque);
950 *statistics += msg;
951 }, &statistics, options.c_str());
952#endif
953
954 return http::OK(statistics, "application/json; charset=utf-8");
955}
956
957
958Future<http::Response> MemoryProfiler::state(

Callers 2

snapshotMethod · 0.45
TEST_FFunction · 0.45

Calls 3

detectJemallocFunction · 0.85
BadRequestClass · 0.85
OKClass · 0.85

Tested by 1

TEST_FFunction · 0.36