]> git.sesse.net Git - nageru/blobdiff - metrics.h
Fix a problem where not all Quick Sync metrics would get initialized.
[nageru] / metrics.h
index a570723dae713f218c9b46c8f0d865ff71e526ad..bd506a97c6c11dfdbc19247706acae5cb995b497 100644 (file)
--- a/metrics.h
+++ b/metrics.h
 
 class Histogram;
 
+// Prometheus recommends the use of timestamps instead of “time since event”,
+// so you can use this to get the number of seconds since the epoch.
+// Note that this will be wrong if your clock changes, so for non-metric use,
+// you should use std::chrono::steady_clock instead.
+double get_timestamp_for_metrics();
+
 class Metrics {
 public:
        enum Type {
@@ -72,6 +78,7 @@ class Histogram {
 public:
        void init(const std::vector<double> &bucket_vals);
        void init_uniform(size_t num_buckets);  // Sets up buckets 0..(N-1).
+       void init_geometric(double min, double max, size_t num_buckets);
        void count_event(double val);
        std::string serialize(const std::string &name, const std::vector<std::pair<std::string, std::string>> &labels) const;