From 62533ded42f5d031d1ff84465af184b8ffbc8270 Mon Sep 17 00:00:00 2001 From: pluris Date: Sun, 20 Aug 2023 00:14:06 +0900 Subject: [PATCH 1/2] src: remove unused function `GetName()` in node_perf --- src/node_perf.cc | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/node_perf.cc b/src/node_perf.cc index 1acaa9dfe47145..787749a4b4c1f7 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -236,18 +236,6 @@ static void RemoveGarbageCollectionTracking( GarbageCollectionCleanupHook(env); } -// Gets the name of a function -inline Local GetName(Local fn) { - Local val = fn->GetDebugName(); - if (val.IsEmpty() || val->IsUndefined()) { - Local boundFunction = fn->GetBoundFunction(); - if (!boundFunction.IsEmpty() && !boundFunction->IsUndefined()) { - val = GetName(boundFunction.As()); - } - } - return val; -} - // Notify a custom PerformanceEntry to observers void Notify(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -277,7 +265,7 @@ void CreateELDHistogram(const FunctionCallbackInfo& args) { IntervalHistogram::Create(env, interval, [](Histogram& histogram) { uint64_t delta = histogram.RecordDelta(); TRACE_COUNTER1(TRACING_CATEGORY_NODE2(perf, event_loop), - "delay", delta); + "delay", delta); TRACE_COUNTER1(TRACING_CATEGORY_NODE2(perf, event_loop), "min", histogram.Min()); TRACE_COUNTER1(TRACING_CATEGORY_NODE2(perf, event_loop), From 517a499704b78b5f269939b7d21794681baa03c4 Mon Sep 17 00:00:00 2001 From: pluris Date: Sun, 20 Aug 2023 01:55:18 +0900 Subject: [PATCH 2/2] fixup! src: remove unused function `GetName()` in node_perf --- src/node_perf.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_perf.cc b/src/node_perf.cc index 787749a4b4c1f7..360cc8bf673073 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -265,7 +265,7 @@ void CreateELDHistogram(const FunctionCallbackInfo& args) { IntervalHistogram::Create(env, interval, [](Histogram& histogram) { uint64_t delta = histogram.RecordDelta(); TRACE_COUNTER1(TRACING_CATEGORY_NODE2(perf, event_loop), - "delay", delta); + "delay", delta); TRACE_COUNTER1(TRACING_CATEGORY_NODE2(perf, event_loop), "min", histogram.Min()); TRACE_COUNTER1(TRACING_CATEGORY_NODE2(perf, event_loop),