|  | @@ -1,6 +1,19 @@
 | 
	
		
			
				|  |  |  #include <benchmark/benchmark.h>
 | 
	
		
			
				|  |  |  #include <prometheus/registry.h>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +static void BM_Counter_IncrementBaseline(benchmark::State& state) {
 | 
	
		
			
				|  |  | +  struct {
 | 
	
		
			
				|  |  | +    void Increment() { v += 1.0; }
 | 
	
		
			
				|  |  | +    double v;
 | 
	
		
			
				|  |  | +  } counter;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  for (auto _ : state) {
 | 
	
		
			
				|  |  | +    counter.Increment();
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  benchmark::DoNotOptimize(counter.v);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +BENCHMARK(BM_Counter_IncrementBaseline);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  static void BM_Counter_Increment(benchmark::State& state) {
 | 
	
		
			
				|  |  |    using prometheus::BuildCounter;
 | 
	
		
			
				|  |  |    using prometheus::Counter;
 | 
	
	
		
			
				|  | @@ -10,9 +23,10 @@ static void BM_Counter_Increment(benchmark::State& state) {
 | 
	
		
			
				|  |  |        BuildCounter().Name("benchmark_counter").Help("").Register(registry);
 | 
	
		
			
				|  |  |    auto& counter = counter_family.Add({});
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  while (state.KeepRunning()) {
 | 
	
		
			
				|  |  | +  for (auto _ : state) {
 | 
	
		
			
				|  |  |      counter.Increment();
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | +  benchmark::DoNotOptimize(counter.Value());
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  BENCHMARK(BM_Counter_Increment);
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -28,6 +42,7 @@ BENCHMARK_F(BM_Counter, ConcurrentIncrement)
 | 
	
		
			
				|  |  |    for (auto _ : state) {
 | 
	
		
			
				|  |  |      counter.Increment();
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | +  benchmark::DoNotOptimize(counter.Value());
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  static void BM_Counter_Collect(benchmark::State& state) {
 |