26 #include <graphlab/logger/assertions.hpp>
27 #include <graphlab/util/tracepoint.hpp>
28 #include <graphlab/parallel/pthread_tools.hpp>
29 #include <boost/unordered_map.hpp>
34 void trace_count::print(std::ostream& out,
unsigned long long tpersec)
const {
36 out << name <<
": " << description <<
"\n";
37 out <<
"Events:\t" << count.value <<
"\n";
38 out <<
"Total:\t" << total.value <<
"ticks \n";
39 if (count.value > 0) {
40 out <<
"Mean:\t" << (double)total.value / count.value <<
"ticks \n";
41 out <<
"Min:\t" << minimum <<
"ticks \n";
42 out <<
"Max:\t" << maximum <<
"ticks \n";
46 double tperms = (double)tpersec / 1000;
47 out << name <<
": " << description <<
"\n";
48 out <<
"Events:\t" << count.value <<
"\n";
49 out <<
"Total:\t" << (double)total.value / tperms <<
" ms \n";
50 if (count.value > 0) {
51 out <<
"Mean:\t" << (double)total.value / count.value / tperms <<
" ms \n";
52 out <<
"Min:\t" << (
double)minimum / tperms <<
" ms \n";
53 out <<
"Max:\t" << (double)maximum / tperms <<
" ms \n";
59 static mutex printlock;
61 trace_count::~trace_count() {
64 print(std::cout, estimate_ticks_per_second());