Ninja
Classes | Macros | Functions | Variables
metrics.h File Reference
#include <string>
#include <vector>
#include "util.h"
Include dependency graph for metrics.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Metric
 The Metrics module is used for the debug mode that dumps timing stats of various actions. More...
 
struct  Metrics
 The singleton that stores metrics and prints the report. More...
 
struct  ScopedMetric
 A scoped object for recording a metric across the body of a function. More...
 
struct  Stopwatch
 A simple stopwatch which returns the time in seconds since Restart() was called. More...
 

Macros

#define METRIC_RECORD(name)
 The primary interface to metrics. More...
 

Functions

int64_t GetTimeMillis ()
 Get the current time as relative to some epoch. More...
 

Variables

Metricsg_metrics
 

Macro Definition Documentation

#define METRIC_RECORD (   name)
Value:
static Metric* metrics_h_metric = \
g_metrics ? g_metrics->NewMetric(name) : NULL; \
ScopedMetric metrics_h_scoped(metrics_h_metric);
Metrics * g_metrics
Definition: metrics.cc:29
The Metrics module is used for the debug mode that dumps timing stats of various actions.
Definition: metrics.h:28
Metric * NewMetric(const string &name)
Definition: metrics.cc:90

The primary interface to metrics.

Use METRIC_RECORD("foobar") at the top of a function to get timing stats recorded for each call of the function.

Definition at line 85 of file metrics.h.

Referenced by CanonicalizePath(), Builder::FinishCommand(), BuildLog::Load(), DepsLog::Load(), ImplicitDepLoader::LoadDepFile(), State::LookupNode(), ManifestParser::Parse(), BuildLog::Recompact(), DepsLog::Recompact(), Builder::StartEdge(), and Node::Stat().

Function Documentation

int64_t GetTimeMillis ( )

Get the current time as relative to some epoch.

Epoch varies between platforms; only useful for measuring elapsed time.

Definition at line 122 of file metrics.cc.

Referenced by BuildStatus::BuildEdgeFinished(), BuildStatus::BuildEdgeStarted(), and main().

Variable Documentation

Metrics* g_metrics

Definition at line 29 of file metrics.cc.