blob: fb905611f8d54299ebd611faf71294dac7699b54 (
plain) (
blame)
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
|
#pragma once
#include <stdint.h>
#include <string>
#include <vector>
#include <map>
class TimingsDatabase
{
public:
struct instance
{
time_t t;
size_t npoints;
double min, max, mean, median, stddev, npskew;
std::vector<uint64_t> deciles;
};
public:
TimingsDatabase();
TimingsDatabase(const std::string &filename);
~TimingsDatabase();
std::vector<instance> get(const char *name) const;
void add(const char *name, const instance &data);
private:
bool load();
bool save();
private:
std::string filename;
std::multimap<std::string, instance> instances;
};
|