rename ProfilingCollector => AsyncProfilerInfo to match nim-metrics naming convention

This commit is contained in:
gmega 2023-11-06 17:16:57 -03:00
parent f16bccfcb6
commit c4adc65823
No known key found for this signature in database
GPG Key ID: FFD8DAF00660270F
2 changed files with 9 additions and 9 deletions

View File

@ -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()

View File

@ -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,