]> git.sesse.net Git - nageru/blob - basic_stats.h
Fix a few Clang warnings.
[nageru] / basic_stats.h
1 #ifndef _BASIC_STATS_H
2 #define _BASIC_STATS_H
3
4 // Holds some metrics for basic statistics about uptime, memory usage and such.
5
6 #include <stdint.h>
7
8 #include <atomic>
9 #include <chrono>
10
11 extern bool uses_mlock;
12
13 class BasicStats {
14 public:
15         BasicStats(bool verbose);
16         void update(int frame_num, int stats_dropped_frames);
17
18 private:
19         std::chrono::steady_clock::time_point start;
20         bool verbose;
21
22         // Metrics.
23         std::atomic<int64_t> metric_frames_output_total{0};
24         std::atomic<int64_t> metric_frames_output_dropped{0};
25         std::atomic<double> metric_start_time_seconds{0.0 / 0.0};
26         std::atomic<int64_t> metrics_memory_used_bytes{0};
27         std::atomic<double> metrics_memory_locked_limit_bytes{0.0 / 0.0};
28 };
29
30 #endif  // !defined(_BASIC_STATS_H)