Bug 1030487 - Don't report main-thread I/O to Telemetry unless it lasts more than 50ms; r=vladan
This commit is contained in:
@@ -411,6 +411,9 @@ void TelemetryIOInterposeObserver::AddPath(const nsAString& aPath,
|
|||||||
mSafeDirs.AppendElement(SafeDir(aPath, aSubstName));
|
mSafeDirs.AppendElement(SafeDir(aPath, aSubstName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Threshold for reporting slow main-thread I/O (50 milliseconds).
|
||||||
|
const TimeDuration kTelemetryReportThreshold = TimeDuration::FromMilliseconds(50);
|
||||||
|
|
||||||
void TelemetryIOInterposeObserver::Observe(Observation& aOb)
|
void TelemetryIOInterposeObserver::Observe(Observation& aOb)
|
||||||
{
|
{
|
||||||
// We only report main-thread I/O
|
// We only report main-thread I/O
|
||||||
@@ -424,6 +427,10 @@ void TelemetryIOInterposeObserver::Observe(Observation& aOb)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (aOb.Duration() < kTelemetryReportThreshold) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Get the filename
|
// Get the filename
|
||||||
const char16_t* filename = aOb.Filename();
|
const char16_t* filename = aOb.Filename();
|
||||||
|
|
||||||
|
|||||||
@@ -350,6 +350,7 @@ public:
|
|||||||
"IOInterposer", false)
|
"IOInterposer", false)
|
||||||
{
|
{
|
||||||
mStart = TimeStamp::Now();
|
mStart = TimeStamp::Now();
|
||||||
|
mEnd = mStart;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user