-
Notifications
You must be signed in to change notification settings - Fork 0
/
stat.h
56 lines (38 loc) · 1.22 KB
/
stat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef SLOPE_STAT_H_
#define SLOPE_STAT_H_
#include <chrono>
#include <string>
#include <unordered_map>
#include "json.hpp"
namespace slope {
namespace stat {
using json = nlohmann::json;
struct LogEntry {
std::chrono::nanoseconds relative_timestamp;
std::string value;
LogEntry(const std::string&);
};
// TODO: make this thread safe
void to_json(json& j, const LogEntry& e) noexcept;
void add_value(const std::string& key, const std::string& val);
void set_meta(const std::string& key, const std::string& val);
void set_param_meta(const std::string& key, const std::string& val);
json get_all_logs();
namespace key {
const std::string operation = "operation";
const std::string warn = "warning";
const std::string log = "logging";
} // namespace key
namespace metakey {
const std::string workload_name = "workload_name";
const std::string node_name = "node_name";
const std::string num_dirty_pages = "num_dirty_pages";
const std::string num_pages = "num_pages";
const std::string using_huge_pages = "using_huge_pages";
} // namespace metakey
namespace value{
const std::string done_time_calibrate = "finished time calibration";
} // namespace value
} // namespace time
} // namespace slope
#endif // SLOPE_STAT_H_