mirror of
https://github.com/oxen-io/oxen-core.git
synced 2023-12-14 02:22:56 +01:00
35 lines
593 B
C++
35 lines
593 B
C++
#pragma once
|
|
|
|
#include <ctime>
|
|
#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<double> 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;
|
|
};
|