Skip to content

Commit 2027424

Browse files
authored
Merge pull request #39 from gjasny/fix-type-mismatches
Build fixes for various platforms
2 parents f1784a0 + 8c9b307 commit 2027424

File tree

7 files changed

+5
-11
lines changed

7 files changed

+5
-11
lines changed

include/prometheus/counter_builder.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ detail::CounterBuilder BuildCounter();
1919
namespace detail {
2020
class CounterBuilder {
2121
public:
22-
friend CounterBuilder BuildCounter();
23-
2422
CounterBuilder& Labels(const std::map<std::string, std::string>& labels);
2523
CounterBuilder& Name(const std::string&);
2624
CounterBuilder& Help(const std::string&);

include/prometheus/gauge_builder.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ detail::GaugeBuilder BuildGauge();
1919
namespace detail {
2020
class GaugeBuilder {
2121
public:
22-
friend GaugeBuilder BuildGauge();
23-
2422
GaugeBuilder& Labels(const std::map<std::string, std::string>& labels);
2523
GaugeBuilder& Name(const std::string&);
2624
GaugeBuilder& Help(const std::string&);

include/prometheus/histogram_builder.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ detail::HistogramBuilder BuildHistogram();
2020
namespace detail {
2121
class HistogramBuilder {
2222
public:
23-
friend HistogramBuilder BuildHistogram();
24-
2523
HistogramBuilder& Labels(const std::map<std::string, std::string>& labels);
2624
HistogramBuilder& Name(const std::string&);
2725
HistogramBuilder& Help(const std::string&);

lib/handler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ bool MetricsHandler::handleGet(CivetServer* server,
7474
"HTTP/1.1 200 OK\r\n"
7575
"Content-Type: %s\r\n",
7676
content_type.c_str());
77-
mg_printf(conn, "Content-Length: %lu\r\n\r\n", body.size());
77+
mg_printf(conn, "Content-Length: %lu\r\n\r\n", static_cast<unsigned long>(body.size()));
7878
mg_write(conn, body.data(), body.size());
7979

8080
auto stop_time_of_request = std::chrono::steady_clock::now();

lib/histogram.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace prometheus {
88

99
Histogram::Histogram(const BucketBoundaries& buckets)
10-
: bucket_boundaries_{buckets}, bucket_counts_(buckets.size() + 1) {}
10+
: bucket_boundaries_(buckets), bucket_counts_(buckets.size() + 1) {}
1111

1212
void Histogram::Observe(double value) {
1313
// TODO: determine bucket list size at which binary search would be faster
@@ -29,7 +29,7 @@ io::prometheus::client::Metric Histogram::Collect() {
2929
histogram->set_sample_count(sample_count);
3030
histogram->set_sample_sum(sum_.Value());
3131

32-
for (int i = 0; i < bucket_counts_.size(); i++) {
32+
for (std::size_t i = 0; i < bucket_counts_.size(); i++) {
3333
auto& count = bucket_counts_[i];
3434
auto bucket = histogram->add_bucket();
3535
bucket->set_cumulative_count(count.Value());

lib/histogram_builder.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "prometheus/gauge_builder.h"
1+
#include "prometheus/histogram_builder.h"
22
#include "prometheus/registry.h"
33

44
namespace prometheus {

tests/benchmark/benchmark_helpers.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ std::map<std::string, std::string> GenerateRandomLabels(
2121
std::size_t number_of_pairs) {
2222
const auto label_character_count = 10;
2323
auto label_pairs = std::map<std::string, std::string>{};
24-
for (int i = 0; i < number_of_pairs; i++) {
24+
for (std::size_t i = 0; i < number_of_pairs; i++) {
2525
label_pairs.insert({GenerateRandomString(label_character_count),
2626
GenerateRandomString(label_character_count)});
2727
}

0 commit comments

Comments
 (0)