forked from ahupowerdns/metronome
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmmanage.cc
More file actions
33 lines (29 loc) · 657 Bytes
/
mmanage.cc
File metadata and controls
33 lines (29 loc) · 657 Bytes
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
#include "statstorage.hh"
#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
using std::cin;
using std::cerr;
using std::cout;
using std::endl;
// syntax: mmanage
int main(int argc, char** argv)
try
{
StatStorage ss("./stats");
auto metrics=ss.getMetrics();
cout<<"Have "<<metrics.size()<<" metrics"<<endl;
for(const auto& m: metrics) {
auto vals=ss.retrieve(m);
cout<<"Have "<<vals.size()<<" values for "<<m<<endl;
ss.store(m, vals);
}
}
catch(std::exception& e)
{
cerr<<"Error: "<<e.what()<<endl;
exit(EXIT_FAILURE);
}