]> git.sesse.net Git - nageru/blobdiff - metrics.h
Expose the start time point instead of the uptime, as per Prometheus recommendations.
[nageru] / metrics.h
index a8156587a5f2484da831eda01af26cc0c4742454..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 {