15 #ifndef NINJA_METRICS_H_ 16 #define NINJA_METRICS_H_ 72 return 1e-6 *
static_cast<double>(
Now() -
started_);
84 #define METRIC_RECORD(name) \ 85 static Metric* metrics_h_metric = \ 86 g_metrics ? g_metrics->NewMetric(name) : NULL; \ 87 ScopedMetric metrics_h_scoped(metrics_h_metric); 91 #endif // NINJA_METRICS_H_ ScopedMetric(Metric *metric)
void Report()
Print a summary report to stdout.
int64_t start_
Timestamp when the measurement started.
int64_t sum
Total time (in micros) we've spent on the code path.
std::vector< Metric * > metrics_
int count
Number of times we've hit the code path.
The Metrics module is used for the debug mode that dumps timing stats of various actions.
A scoped object for recording a metric across the body of a function.
signed long long int64_t
A 64-bit integer type.
Metric * NewMetric(const std::string &name)
double Elapsed() const
Seconds since Restart() call.
The singleton that stores metrics and prints the report.
int64_t GetTimeMillis()
Get the current time as relative to some epoch.
unsigned long long uint64_t
A simple stopwatch which returns the time in seconds since Restart() was called.