Skip to content

Commit

Permalink
chore(clang-format): Format everything
Browse files Browse the repository at this point in the history
  • Loading branch information
gjasny committed Oct 17, 2019
1 parent 05f5b89 commit c216ae7
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion core/benchmarks/summary_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include <random>

#include <benchmark/benchmark.h>
#include <prometheus/summary.h>
#include <prometheus/registry.h>
#include <prometheus/summary.h>

using prometheus::Summary;

Expand Down
12 changes: 6 additions & 6 deletions core/include/prometheus/detail/core_export.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

#if defined(_WIN32)
# ifdef PROMETHEUS_CPP_COMPILE_CORE
# define PROMETHEUS_CPP_CORE_EXPORT __declspec(dllexport)
# else
# define PROMETHEUS_CPP_CORE_EXPORT __declspec(dllimport)
# endif
#ifdef PROMETHEUS_CPP_COMPILE_CORE
#define PROMETHEUS_CPP_CORE_EXPORT __declspec(dllexport)
#else
# define PROMETHEUS_CPP_CORE_EXPORT __attribute__((visibility("default")))
#define PROMETHEUS_CPP_CORE_EXPORT __declspec(dllimport)
#endif
#else
#define PROMETHEUS_CPP_CORE_EXPORT __attribute__((visibility("default")))
#endif
2 changes: 1 addition & 1 deletion core/include/prometheus/summary.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <vector>

#include "prometheus/client_metric.h"
#include "prometheus/detail/ckms_quantiles.h"
#include "prometheus/detail/builder.h"
#include "prometheus/detail/ckms_quantiles.h"
#include "prometheus/detail/core_export.h"
#include "prometheus/detail/time_window_quantiles.h"
#include "prometheus/metric_type.h"
Expand Down
9 changes: 6 additions & 3 deletions core/src/histogram.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,17 @@ void Histogram::Observe(const double value) {
void Histogram::ObserveMultiple(const std::vector<double> bucket_increments,
const double sum_of_values) {
if (bucket_increments.size() != bucket_counts_.size()) {
throw std::length_error("The size of bucket_increments was not equal to"
"the number of buckets in the histogram.");
throw std::length_error(
"The size of bucket_increments was not equal to"
"the number of buckets in the histogram.");
}

sum_.Increment(sum_of_values);

for (std::size_t i{0}; i < bucket_counts_.size(); ++i) {
{ bucket_counts_[i].Increment(bucket_increments[i]); }
{
bucket_counts_[i].Increment(bucket_increments[i]);
}
}
}

Expand Down
3 changes: 1 addition & 2 deletions core/tests/histogram_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ TEST(HistogramTest, observe_multiple_test_length_error) {
Histogram histogram{{1, 2}};
// 2 bucket boundaries means there are 3 buckets, so giving just 2 bucket
// increments should result in a length_error.
ASSERT_THROW(histogram.ObserveMultiple({5, 9}, 20),
std::length_error);
ASSERT_THROW(histogram.ObserveMultiple({5, 9}, 20), std::length_error);
}

} // namespace
Expand Down
2 changes: 1 addition & 1 deletion core/tests/registry_test.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "prometheus/registry.h"
#include "prometheus/counter.h"
#include "prometheus/histogram.h"
#include "prometheus/registry.h"

#include <vector>

Expand Down
12 changes: 6 additions & 6 deletions pull/include/prometheus/detail/pull_export.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

#if defined(_WIN32)
# ifdef PROMETHEUS_CPP_COMPILE_PULL
# define PROMETHEUS_CPP_PULL_EXPORT __declspec(dllexport)
# else
# define PROMETHEUS_CPP_PULL_EXPORT __declspec(dllimport)
# endif
#ifdef PROMETHEUS_CPP_COMPILE_PULL
#define PROMETHEUS_CPP_PULL_EXPORT __declspec(dllexport)
#else
# define PROMETHEUS_CPP_PULL_EXPORT __attribute__((visibility("default")))
#define PROMETHEUS_CPP_PULL_EXPORT __declspec(dllimport)
#endif
#else
#define PROMETHEUS_CPP_PULL_EXPORT __attribute__((visibility("default")))
#endif
10 changes: 5 additions & 5 deletions pull/src/exposer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

namespace prometheus {

Exposer::Exposer(const std::string& bind_address, const std::string& uri, const std::size_t num_threads)
: server_(new CivetServer{
std::vector<std::string>{
"listening_ports", bind_address,
"num_threads", std::to_string(num_threads)}}),
Exposer::Exposer(const std::string& bind_address, const std::string& uri,
const std::size_t num_threads)
: server_(new CivetServer{std::vector<std::string>{
"listening_ports", bind_address, "num_threads",
std::to_string(num_threads)}}),
exposer_registry_(std::make_shared<Registry>()),
metrics_handler_(
new detail::MetricsHandler{collectables_, *exposer_registry_}),
Expand Down
12 changes: 6 additions & 6 deletions push/include/prometheus/detail/push_export.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

#if defined(_WIN32)
# ifdef PROMETHEUS_CPP_COMPILE_PUSH
# define PROMETHEUS_CPP_PUSH_EXPORT __declspec(dllexport)
# else
# define PROMETHEUS_CPP_PUSH_EXPORT __declspec(dllimport)
# endif
#ifdef PROMETHEUS_CPP_COMPILE_PUSH
#define PROMETHEUS_CPP_PUSH_EXPORT __declspec(dllexport)
#else
# define PROMETHEUS_CPP_PUSH_EXPORT __attribute__((visibility("default")))
#define PROMETHEUS_CPP_PUSH_EXPORT __declspec(dllimport)
#endif
#else
#define PROMETHEUS_CPP_PUSH_EXPORT __attribute__((visibility("default")))
#endif

0 comments on commit c216ae7

Please sign in to comment.