From c4adc6582393fdb5e76033d61a194a862e3d3202 Mon Sep 17 00:00:00 2001 From: gmega Date: Mon, 6 Nov 2023 17:16:57 -0300 Subject: [PATCH] rename ProfilingCollector => AsyncProfilerInfo to match nim-metrics naming convention --- codex/utils/asyncprofiler/metricscollector.nim | 14 +++++++------- .../utils/asyncprofiler/testmetricscollector.nim | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/codex/utils/asyncprofiler/metricscollector.nim b/codex/utils/asyncprofiler/metricscollector.nim index c7737708..3a6f4f5c 100644 --- a/codex/utils/asyncprofiler/metricscollector.nim +++ b/codex/utils/asyncprofiler/metricscollector.nim @@ -8,7 +8,7 @@ import metrics when defined(metrics): type - ProfilingCollector* = ref object of Gauge + ProfilerInfo* = ref object of Gauge perfSampler: PerfSampler k: int @@ -17,14 +17,14 @@ when defined(metrics): ProfilerMetric = (SrcLoc, OverallMetrics) proc newCollector*( - ProfilingCollector: typedesc, + ProfilerInfo: typedesc, name: string, help: string, perfSampler: PerfSampler, k: int = 10, registry: Registry = defaultRegistry, - ): ProfilingCollector = - result = ProfilingCollector.newCollector( + ): ProfilerInfo = + result = ProfilerInfo.newCollector( name = name, help = help, registry = registry) result.perfSampler = perfSampler result.k = k @@ -33,7 +33,7 @@ when defined(metrics): float64 = duration.nanoseconds.float64 proc collectSlowestProcs( - self: ProfilingCollector, + self: ProfilerInfo, profilerMetrics: seq[ProfilerMetric], prometheusMetrics: var Metrics, timestampMillis: int64, @@ -82,7 +82,7 @@ when defined(metrics): "max_single_exec_time", metrics.maxSingleTime, prometheusMetrics) proc collectOutlierMetrics( - self: ProfilingCollector, + self: ProfilerInfo, profilerMetrics: seq[ProfilerMetric], prometheusMetrics: var Metrics, timestampMillis: int64, @@ -112,7 +112,7 @@ when defined(metrics): timestamp: timestampMillis, )) - method collect*(self: ProfilingCollector): Metrics = + method collect*(self: ProfilerInfo): Metrics = let now = times.getTime().toMilliseconds() var prometheusMetrics = Metrics() diff --git a/tests/codex/utils/asyncprofiler/testmetricscollector.nim b/tests/codex/utils/asyncprofiler/testmetricscollector.nim index ec4b4791..d62fd130 100644 --- a/tests/codex/utils/asyncprofiler/testmetricscollector.nim +++ b/tests/codex/utils/asyncprofiler/testmetricscollector.nim @@ -52,7 +52,7 @@ checksuite "asyncprofiler metrics collector": test "should keep track of basic worst-case exec time stats": var registry = newRegistry() - var collector = ProfilingCollector.newCollector( + var collector = ProfilerInfo.newCollector( name = "profiling_metrics", help = "Metrics from the profiler", registry = registry, @@ -64,7 +64,7 @@ checksuite "asyncprofiler metrics collector": test "should create labeled series for the k slowest procs in terms of totalExecTime": var registry = newRegistry() - var collector = ProfilingCollector.newCollector( + var collector = ProfilerInfo.newCollector( name = "profiling_metrics", help = "Metrics from the profiler", registry = registry,