Skip to content

Commit 9454c98

Browse files
committed
address feedback
1 parent 3032be0 commit 9454c98

13 files changed

+15
-10
lines changed

Benchmarks/Benchmarks/PrometheusBenchmarks/Benchmarks.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,13 @@ public func makeLabels(_ idx: Int) -> [(String, String)] {
3030
let benchmarks = {
3131
Benchmark.defaultConfiguration.maxDuration = .seconds(5)
3232
Benchmark.defaultConfiguration.scalingFactor = .kilo
33-
// Benchmark.defaultConfiguration.metrics = [.wallClock, .throughput, .mallocCountTotal]
3433
Benchmark.defaultConfiguration.metrics = [.mallocCountTotal]
3534

36-
Benchmark("Counter #1") { benchmark in
35+
Benchmark("Counter - setup and increment") { benchmark in
3736
runCounterBench(benchmark.scaledIterations)
3837
}
3938

40-
Benchmark("Counter #2") { benchmark, run in
39+
Benchmark("Counter - increment only") { benchmark, run in
4140
for _ in benchmark.scaledIterations {
4241
run()
4342
}

Benchmarks/Benchmarks/PrometheusBenchmarks/DurationHistogram.swift

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ import Benchmark
1717
import Prometheus
1818

1919
public func runDurationHistogramBench(_ iterations: Range<Int>) {
20-
let histogram = registry.makeDurationHistogram(name: "histogram_1", labels: makeLabels(3),
21-
buckets: [
22-
.milliseconds(100),
23-
.milliseconds(250),
24-
.milliseconds(500),
25-
.seconds(1),
26-
])
20+
let histogram = registry.makeDurationHistogram(
21+
name: "histogram_1",
22+
labels: makeLabels(3),
23+
buckets: [
24+
.milliseconds(100),
25+
.milliseconds(250),
26+
.milliseconds(500),
27+
.seconds(1),
28+
]
29+
)
2730
for _ in iterations {
2831
blackHole(histogram.record(Duration.milliseconds(400)))
2932
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mallocCountTotal" : 1
3+
}

0 commit comments

Comments
 (0)