31 static Stats instance;
53 return out << std::setw(10) << std::right << std::chrono::duration_cast<std::chrono::microseconds>(
d).
count() <<
" us";
65 auto& out = std::cout;
69 std::advance(itr,
m_stats.size() / 2);
73 return a + v.duration;
76 out <<
"\nSTATS:\n\n" << std::setfill(
' ');
82 auto usecs = std::chrono::duration_cast<std::chrono::microseconds>(s.duration).
count();
83 out <<
" " << std::setw(40) << std::left << s.name.substr(0, 40) << s.duration;
86 auto gasRate = uint64_t(
double(s.gasUsed) * 1000 / usecs);
87 out <<
"\t" << std::setw(10) << std::right << gasRate <<
" gas/ms\n";
100 auto usecs = std::chrono::duration_cast<std::chrono::microseconds>(s.duration).
count();
101 file << s.name <<
"\t" << usecs;
104 auto gasRate = s.gasUsed / usecs;
105 file <<
"\t" << gasRate <<
" gas/us\n";
112 out <<
" tot: " <<
tot <<
"\n" 113 <<
" avg: " << (
tot /
m_stats.size()) <<
"\n\n" 114 <<
" min: " <<
min.duration <<
" (" <<
min.name <<
")\n" 115 <<
" med: " << med.duration <<
" (" << med.name <<
")\n" 116 <<
" max: " <<
max.duration <<
" (" <<
max.name <<
")\n";
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
static Options const & get(int argc=0, char **argv=0)
Get reference to options The first time used, options are parsed with argc, argv. ...
std::string m_currentTest
std::string statsOutFile
Stats output file. "out" for standard output.
void suiteStarted(std::string const &_name) override
std::string m_currentSuite
Class for handling testeth custom options.
void testStarted(std::string const &_name) override
void testFinished(int64_t _gasUsed) override
std::vector< Item > m_stats
std::ostream & operator<<(std::ostream &out, Stats::clock::duration const &d)