• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jupp0r / prometheus-cpp / 4192383612

pending completion
4192383612

Pull #634

github

GitHub
Merge 039bc354a into 1833c1848
Pull Request #634: Update deps

773 of 802 relevant lines covered (96.38%)

109256.95 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/core/include/prometheus/detail/time_window_quantiles.h
1
#pragma once
2

3
#include <chrono>
4
#include <cstddef>
5
#include <vector>
6

7
#include "prometheus/detail/ckms_quantiles.h"  // IWYU pragma: export
8
#include "prometheus/detail/core_export.h"
9

10
// IWYU pragma: private, include "prometheus/summary.h"
11

12
namespace prometheus {
13
namespace detail {
14

15
class PROMETHEUS_CPP_CORE_EXPORT TimeWindowQuantiles {
16
  using Clock = std::chrono::steady_clock;
17

18
 public:
19
  TimeWindowQuantiles(const std::vector<CKMSQuantiles::Quantile>& quantiles,
20
                      Clock::duration max_age_seconds, int age_buckets);
21

22
  double get(double q) const;
23
  void insert(double value);
24

25
 private:
26
  CKMSQuantiles& rotate() const;
27

28
  const std::vector<CKMSQuantiles::Quantile>& quantiles_;
29
  mutable std::vector<CKMSQuantiles> ckms_quantiles_;
30
  mutable std::size_t current_bucket_;
31

32
  mutable Clock::time_point last_rotation_;
33
  const Clock::duration rotation_interval_;
34
};
35

36
}  // namespace detail
37
}  // namespace prometheus
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc