From 0f17cbe783e27271c1639d4ee22b66e0f8d45fd6 Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Thu, 16 Nov 2023 19:47:16 +0800 Subject: [PATCH] comments --- src/http/pprof_http_service.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/http/pprof_http_service.cpp b/src/http/pprof_http_service.cpp index b3c35d4506..ab4767f5c6 100644 --- a/src/http/pprof_http_service.cpp +++ b/src/http/pprof_http_service.cpp @@ -364,12 +364,11 @@ void pprof_http_service::heap_handler(const http_request &req, http_response &re } auto cleanup = dsn::defer([this]() { _in_pprof_action.store(false); }); - // If kSecondParam is specified with a valid value, we'll use heap profiling, + // If "seconds" parameter is specified with a valid value, use heap profiling, // otherwise, use heap sampling. bool use_heap_profile = false; - const std::string kSecondParam = "seconds"; uint32_t seconds = 0; - const auto &iter = req.query_args.find(kSecondParam); + const auto &iter = req.query_args.find("seconds"); if (iter != req.query_args.end() && buf2uint32(iter->second, seconds)) { // This is true between calls to HeapProfilerStart() and HeapProfilerStop(), and // also if the program has been run with HEAPPROFILER, or some other