Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Build fix: PrometheusExporter::Collect was made const. (#428)
Browse files Browse the repository at this point in the history
jupp0r/prometheus-cpp#323

Also format with newer version of cmake-format.
  • Loading branch information
g-easy authored Jan 8, 2020
1 parent 3c0ff4e commit 4a60079
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions opencensus/common/internal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ opencensus_lib(
opencensus_lib(common_stats_object DEPS absl::time)

# Define NOMINMAX to fix build errors when compiling with MSVC.
target_compile_definitions(opencensus_common_stats_object INTERFACE
$<$<CXX_COMPILER_ID:MSVC>:NOMINMAX>)
target_compile_definitions(opencensus_common_stats_object
INTERFACE $<$<CXX_COMPILER_ID:MSVC>:NOMINMAX>)

opencensus_lib(common_string_vector_hash DEPS absl::hash)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace opencensus {
namespace exporters {
namespace stats {

std::vector<prometheus::MetricFamily> PrometheusExporter::Collect() {
std::vector<prometheus::MetricFamily> PrometheusExporter::Collect() const {
const auto data = opencensus::stats::StatsExporter::GetViewData();
std::vector<prometheus::MetricFamily> output(data.size());
for (int i = 0; i < data.size(); ++i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace stats {
// PrometheusExporter is thread-safe.
class PrometheusExporter final : public ::prometheus::Collectable {
public:
std::vector<prometheus::MetricFamily> Collect() override;
std::vector<prometheus::MetricFamily> Collect() const override;
};

} // namespace stats
Expand Down
4 changes: 2 additions & 2 deletions opencensus/stats/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ opencensus_lib(
absl::span)

# Define NOMINMAX to fix build errors when compiling with MSVC.
target_compile_definitions(opencensus_stats_core PUBLIC
$<$<CXX_COMPILER_ID:MSVC>:NOMINMAX>)
target_compile_definitions(opencensus_stats_core
PUBLIC $<$<CXX_COMPILER_ID:MSVC>:NOMINMAX>)

opencensus_lib(
stats_recording
Expand Down
4 changes: 2 additions & 2 deletions opencensus/trace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ opencensus_lib(
absl::span)

# Define NOMINMAX to fix build errors when compiling with MSVC.
target_compile_definitions(opencensus_trace PUBLIC
$<$<CXX_COMPILER_ID:MSVC>:NOMINMAX>)
target_compile_definitions(opencensus_trace
PUBLIC $<$<CXX_COMPILER_ID:MSVC>:NOMINMAX>)

opencensus_lib(
trace_b3
Expand Down

0 comments on commit 4a60079

Please sign in to comment.