Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 036003d

Browse files
committed
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.
1 parent 2fc5b9e commit 036003d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/disk_interface.cc

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <direct.h> // _mkdir
2929
#endif
3030

31+
#include "metrics.h"
3132
#include "util.h"
3233

3334
namespace {
@@ -148,6 +149,7 @@ bool DiskInterface::MakeDirs(const string& path) {
148149
// RealDiskInterface -----------------------------------------------------------
149150

150151
TimeStamp RealDiskInterface::Stat(const string& path, string* err) const {
152+
METRIC_RECORD("node stat");
151153
#ifdef _WIN32
152154
// MSDN: "Naming Files, Paths, and Namespaces"
153155
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx

src/graph.cc

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "util.h"
2929

3030
bool Node::Stat(DiskInterface* disk_interface, string* err) {
31-
METRIC_RECORD("node stat");
3231
return (mtime_ = disk_interface->Stat(path_, err)) != -1;
3332
}
3433

0 commit comments

Comments
 (0)