Skip to content

Commit

Permalink
Merge e885e62 into ddf7083
Browse files Browse the repository at this point in the history
  • Loading branch information
gjasny committed Nov 12, 2021
2 parents ddf7083 + e885e62 commit 60b8def
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 4 deletions.
6 changes: 4 additions & 2 deletions core/benchmarks/histogram_bench.cc
@@ -1,6 +1,7 @@
#include <benchmark/benchmark.h>

#include <chrono>
#include <cstdint>
#include <random>
#include <string>
#include <vector>
Expand All @@ -11,8 +12,9 @@

using prometheus::Histogram;

static Histogram::BucketBoundaries CreateLinearBuckets(double start, double end,
double step) {
static Histogram::BucketBoundaries CreateLinearBuckets(std::int64_t start,
std::int64_t end,
std::int64_t step) {
auto bucket_boundaries = Histogram::BucketBoundaries{};
for (auto i = start; i < end; i += step) {
bucket_boundaries.push_back(i);
Expand Down
14 changes: 13 additions & 1 deletion core/include/prometheus/registry.h
Expand Up @@ -61,8 +61,20 @@ class PROMETHEUS_CPP_CORE_EXPORT Registry : public Collectable {
/// \param insert_behavior How to handle families with the same name.
explicit Registry(InsertBehavior insert_behavior = InsertBehavior::Merge);

/// \brief Deleted copy constructor.
Registry(const Registry&) = delete;

/// \brief Deleted copy assignment.
Registry& operator=(const Registry&) = delete;

/// \brief Deleted move constructor.
Registry(Registry&&) = delete;

/// \brief Deleted move assignment.
Registry& operator=(Registry&&) = delete;

/// \brief name Destroys a registry.
~Registry();
~Registry() override;

/// \brief Returns a list of metrics and their samples.
///
Expand Down
5 changes: 5 additions & 0 deletions core/tests/raii_locale.h
Expand Up @@ -10,6 +10,11 @@ class RAIILocale {

~RAIILocale() { std::locale::global(savedLocale_); }

RAIILocale(const RAIILocale&) = delete;
RAIILocale(RAIILocale&&) = delete;
RAIILocale& operator=(const RAIILocale&) = delete;
RAIILocale& operator=(RAIILocale&&) = delete;

private:
const std::locale savedLocale_;
};
2 changes: 1 addition & 1 deletion core/tests/summary_test.cc
Expand Up @@ -75,7 +75,7 @@ TEST(SummaryTest, max_age) {
2};
summary.Observe(8.0);

static const auto test_value = [&summary](double ref) {
const auto test_value = [&summary](double ref) {
auto metric = summary.Collect();
auto s = metric.summary;
ASSERT_EQ(s.quantile.size(), 1U);
Expand Down
6 changes: 6 additions & 0 deletions pull/include/prometheus/exposer.h
Expand Up @@ -26,6 +26,12 @@ class PROMETHEUS_CPP_PULL_EXPORT Exposer {
explicit Exposer(std::vector<std::string> options,
const CivetCallbacks* callbacks = nullptr);
~Exposer();

Exposer(const Exposer&) = delete;
Exposer(Exposer&&) = delete;
Exposer& operator=(const Exposer&) = delete;
Exposer& operator=(Exposer&&) = delete;

void RegisterCollectable(const std::weak_ptr<Collectable>& collectable,
const std::string& uri = std::string("/metrics"));

Expand Down
5 changes: 5 additions & 0 deletions pull/src/endpoint.h
Expand Up @@ -18,6 +18,11 @@ class Endpoint {
explicit Endpoint(CivetServer& server, std::string uri);
~Endpoint();

Endpoint(const Endpoint&) = delete;
Endpoint(Endpoint&&) = delete;
Endpoint& operator=(const Endpoint&) = delete;
Endpoint& operator=(Endpoint&&) = delete;

void RegisterCollectable(const std::weak_ptr<Collectable>& collectable);
void RegisterAuth(
std::function<bool(const std::string&, const std::string&)> authCB,
Expand Down

0 comments on commit 60b8def

Please sign in to comment.