11 namespace statistics {
18 template<StatisticsOutputFormat SOF>
21 template<StatisticsOutputFormat SOF>
27 if (s->collected().empty())
continue;
28 os <<
"(:" << s->name() <<
" (" << std::endl;
29 std::size_t max_width = 0;
30 for (
const auto& kv: s->collected()) {
31 max_width = std::max(max_width, kv.first.size());
33 for (
const auto& kv: s->collected()) {
34 os <<
"\t:" << std::setw(
static_cast<int>(max_width)) << std::left << kv.first <<
" " << kv.second << std::endl;
36 os <<
"))" << std::endl;
44 if (s->collected().empty())
continue;
45 std::string name = s->name();
46 std::replace(name.begin(), name.end(),
'<',
'(');
47 std::replace(name.begin(), name.end(),
'>',
')');
48 os <<
"\t<module name=\"" << name <<
"\">\n";
49 for (
const auto& kv: s->collected()) {
50 os <<
"\t\t<stat name=\"" << kv.first <<
"\" value=\"" << kv.second <<
"\" />\n";
52 os <<
"\t</module>\n";
66 file.open(filename, std::ios::out);
67 file <<
"<runtimestats>" << std::endl;
69 file <<
"</runtimestats>" << std::endl;
carl is the main namespace for the library.
auto statistics_as_smtlib()
void statistics_to_xml_file(const std::string &filename)
std::ostream & operator<<(std::ostream &os, StatisticsPrinter< SOF >)
static StatisticsCollector & getInstance()
Returns the single instance of this class by reference.