30 #ifndef DEF_GRAPHCHI_FILE_REPORTER
31 #define DEF_GRAPHCHI_FILE_REPORTER
54 f = fopen(fname.c_str(),
"a");
58 virtual void do_report(std::string name, std::string ident, std::map<std::string, metrics_entry> & entries) {
60 fprintf(f,
"[%s:%s]\n", name.c_str(), ident.c_str());
62 fprintf(f,
"[%s]\n", name.c_str());
64 std::map<std::string, metrics_entry>::iterator it;
66 for(it = entries.begin(); it != entries.end(); ++it) {
71 fprintf(f,
"%s.%s=%ld\n", ident.c_str(), it->first.c_str(), (
long int) (ent.value));
72 fprintf(f,
"%s.%s.count=%lu\n", ident.c_str(), it->first.c_str(), ent.count);
73 fprintf(f,
"%s.%s.min=%ld\n", ident.c_str(), it->first.c_str(), (
long int) (ent.minvalue));
74 fprintf(f,
"%s.%s.max=%ld\n", ident.c_str(), it->first.c_str(), (
long int) (ent.maxvalue));
75 fprintf(f,
"%s.%s.avg=%lf\n", ident.c_str(), it->first.c_str(), ent.cumvalue/ent.count);
79 fprintf(f,
"%s.%s=%lf\n", ident.c_str(), it->first.c_str(), (ent.value));
80 fprintf(f,
"%s.%s.count=%lu\n", ident.c_str(), it->first.c_str(), ent.count);
81 fprintf(f,
"%s.%s.min=%lf\n", ident.c_str(), it->first.c_str(), (ent.minvalue));
82 fprintf(f,
"%s.%s.max=%lf\n", ident.c_str(), it->first.c_str(), (ent.maxvalue));
83 fprintf(f,
"%s.%s.avg=%lf\n", ident.c_str(), it->first.c_str(), ent.cumvalue/ent.count);
86 fprintf(f,
"%s.%s=%s\n", ident.c_str(), it->first.c_str(), it->second.stringval.c_str());
93 std::string cmd =
"python2.7 benchtodb.py " + filename;