Skip to content

Commit

Permalink
Revert, back to solution 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff committed Oct 9, 2023
1 parent ae1fdad commit ed66352
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sdk/include/opentelemetry/sdk/trace/samplers/parent.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class ParentBasedSampler : public Sampler
nostd::string_view GetDescription() const noexcept override;

private:
std::shared_ptr<Sampler> delegate_sampler_;
std::string description_;
const std::shared_ptr<Sampler> delegate_sampler_;
const std::string description_;
};
} // namespace trace
} // namespace sdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class TraceIdRatioBasedSampler : public Sampler

private:
std::string description_;
uint64_t threshold_;
const uint64_t threshold_;
};
} // namespace trace
} // namespace sdk
Expand Down
6 changes: 6 additions & 0 deletions sdk/test/trace/sampler_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ void BM_AlwaysOnSamplerConstruction(benchmark::State &state)
}
BENCHMARK(BM_AlwaysOnSamplerConstruction);

/*
Fails to build with GCC.
See upstream bug: https://github.com/google/benchmark/issues/1675
*/
#if 0
void BM_ParentBasedSamplerConstruction(benchmark::State &state)
{
while (state.KeepRunning())
Expand All @@ -59,6 +64,7 @@ void BM_TraceIdRatioBasedSamplerConstruction(benchmark::State &state)
}
}
BENCHMARK(BM_TraceIdRatioBasedSamplerConstruction);
#endif

// Sampler Helper Function
void BenchmarkShouldSampler(Sampler &sampler, benchmark::State &state)
Expand Down

0 comments on commit ed66352

Please sign in to comment.