15 #ifndef NINJA_METRICS_H_ 16 #define NINJA_METRICS_H_ 52 Metric* NewMetric(
const string& name);
73 return 1e-6 *
static_cast<double>(Now() - started_);
85 #define METRIC_RECORD(name) \ 86 static Metric* metrics_h_metric = \ 87 g_metrics ? g_metrics->NewMetric(name) : NULL; \ 88 ScopedMetric metrics_h_scoped(metrics_h_metric); 92 #endif // NINJA_METRICS_H_ int64_t start_
Timestamp when the measurement started.
int64_t sum
Total time (in micros) we've spent on the code path.
int count
Number of times we've hit the code path.
double Elapsed() const
Seconds since Restart() call.
vector< Metric * > metrics_
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.
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.