Skip to content

Commit

Permalink
Fix WithGcStats buckets being ignored. (#66)
Browse files Browse the repository at this point in the history
opts.HistogramBuckets is initialized always so using ??= never does anything.
  • Loading branch information
PJB3005 authored Feb 1, 2022
1 parent 1ca6b88 commit bf760ca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/prometheus-net.DotNetRuntime/DotNetRuntimeStatsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,9 @@ public Builder WithGcStats(CaptureLevel atLevel = CaptureLevel.Counters, double[
_services.TryAddSingletonEnumerable<IMetricProducer, GcMetricsProducer>();

var opts = new GcMetricsProducer.Options();
opts.HistogramBuckets ??= histogramBuckets;

if (histogramBuckets != null)
opts.HistogramBuckets = histogramBuckets;

_services.AddSingleton(opts);

return this;
Expand Down

0 comments on commit bf760ca

Please sign in to comment.