From 036003d20e80cbb044a3f0f0b41e2fdefcde66af Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 22 May 2017 11:27:14 -0700 Subject: Move stat metric to DiskInterface Stat is not always used through Node::Stat, it is often used directly through DiskInterface. THe next patches will cause it to be called even more often through DiskInterface, so move the metrics to DiskInterface. --- src/disk_interface.cc | 2 ++ src/graph.cc | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/disk_interface.cc b/src/disk_interface.cc index 1b4135f..b418e04 100644 --- a/src/disk_interface.cc +++ b/src/disk_interface.cc @@ -28,6 +28,7 @@ #include // _mkdir #endif +#include "metrics.h" #include "util.h" namespace { @@ -148,6 +149,7 @@ bool DiskInterface::MakeDirs(const string& path) { // RealDiskInterface ----------------------------------------------------------- TimeStamp RealDiskInterface::Stat(const string& path, string* err) const { + METRIC_RECORD("node stat"); #ifdef _WIN32 // MSDN: "Naming Files, Paths, and Namespaces" // http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx diff --git a/src/graph.cc b/src/graph.cc index b4c8619..76d996b 100644 --- a/src/graph.cc +++ b/src/graph.cc @@ -28,7 +28,6 @@ #include "util.h" bool Node::Stat(DiskInterface* disk_interface, string* err) { - METRIC_RECORD("node stat"); return (mtime_ = disk_interface->Stat(path_, err)) != -1; } -- cgit v0.12