| 67 | } |
| 68 | |
| 69 | void cerr_logger::report() |
| 70 | { |
| 71 | cerr << endl << "queries: " << queries << endl; |
| 72 | // << " (" << 1000.0*query_count/gen_time.count() << " gen/s, " |
| 73 | // << 1000.0*query_count/query_time.count() << " exec/s)" << endl; |
| 74 | cerr << "AST stats (avg): height = " << sum_height/queries |
| 75 | << " nodes = " << sum_nodes/queries << endl; |
| 76 | |
| 77 | vector<pair<std::string, long> > report; |
| 78 | for (auto e : errors) { |
| 79 | report.push_back(e); |
| 80 | } |
| 81 | stable_sort(report.begin(), report.end(), |
| 82 | [](const pair<std::string, long> &a, |
| 83 | const pair<std::string, long> &b) |
| 84 | { return a.second > b.second; }); |
| 85 | long err_count = 0; |
| 86 | for (auto e : report) { |
| 87 | err_count += e.second; |
| 88 | cerr << e.second << "\t" << e.first.substr(0,80) << endl; |
| 89 | } |
| 90 | cerr << "error rate: " << (float)err_count/(queries) << endl; |
| 91 | impedance::report(); |
| 92 | } |
| 93 | |
| 94 | |
| 95 | void cerr_logger::generated(prod &p) |
no test coverage detected