mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 22:32:51 +00:00
Bug 682869 - update places to use Telemetry::AccumulateTimeDelta. r=tglek,khuey,jduell
--HG-- extra : rebase_source : 2b691d94f8352efb13e92294e22844e6473fd458
This commit is contained in:
parent
06ab837c25
commit
645296f209
@ -6123,13 +6123,10 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress,
|
||||
if (timingChannel) {
|
||||
TimeStamp channelCreationTime;
|
||||
rv = timingChannel->GetChannelCreation(&channelCreationTime);
|
||||
if (NS_SUCCEEDED(rv) && !channelCreationTime.IsNull()) {
|
||||
PRUint32 interval = (PRUint32)
|
||||
(TimeStamp::Now() - channelCreationTime)
|
||||
.ToMilliseconds();
|
||||
Telemetry::Accumulate(Telemetry::TOTAL_CONTENT_PAGE_LOAD_TIME,
|
||||
interval);
|
||||
}
|
||||
if (NS_SUCCEEDED(rv) && !channelCreationTime.IsNull())
|
||||
Telemetry::AccumulateTimeDelta(
|
||||
Telemetry::TOTAL_CONTENT_PAGE_LOAD_TIME,
|
||||
channelCreationTime);
|
||||
}
|
||||
|
||||
// Timing is picked up by the window, we don't need it anymore
|
||||
|
@ -71,9 +71,6 @@ static PRLogModuleInfo* gLoadGroupLog = nsnull;
|
||||
|
||||
#define LOG(args) PR_LOG(gLoadGroupLog, PR_LOG_DEBUG, args)
|
||||
|
||||
#define HISTOGRAM_TIME_DELTA(start, end) \
|
||||
(PRUint32)((end - start).ToMilliseconds())
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class RequestMapEntry : public PLDHashEntryHdr
|
||||
@ -693,16 +690,16 @@ nsLoadGroup::RemoveRequest(nsIRequest *request, nsISupports* ctxt,
|
||||
|
||||
rv = timedChannel->GetAsyncOpen(&timeStamp);
|
||||
if (NS_SUCCEEDED(rv) && !timeStamp.IsNull()) {
|
||||
Telemetry::Accumulate(
|
||||
Telemetry::AccumulateTimeDelta(
|
||||
Telemetry::HTTP_SUBITEM_OPEN_LATENCY_TIME,
|
||||
HISTOGRAM_TIME_DELTA(mDefaultRequestCreationTime, timeStamp));
|
||||
mDefaultRequestCreationTime, timeStamp);
|
||||
}
|
||||
|
||||
rv = timedChannel->GetResponseStart(&timeStamp);
|
||||
if (NS_SUCCEEDED(rv) && !timeStamp.IsNull()) {
|
||||
Telemetry::Accumulate(
|
||||
Telemetry::AccumulateTimeDelta(
|
||||
Telemetry::HTTP_SUBITEM_FIRST_BYTE_LATENCY_TIME,
|
||||
HISTOGRAM_TIME_DELTA(mDefaultRequestCreationTime, timeStamp));
|
||||
mDefaultRequestCreationTime, timeStamp);
|
||||
}
|
||||
|
||||
TelemetryReportChannel(timedChannel, false);
|
||||
@ -940,71 +937,71 @@ nsLoadGroup::TelemetryReportChannel(nsITimedChannel *aTimedChannel,
|
||||
|
||||
#define HTTP_REQUEST_HISTOGRAMS(prefix) \
|
||||
if (!domainLookupStart.IsNull()) { \
|
||||
Telemetry::Accumulate( \
|
||||
Telemetry::AccumulateTimeDelta( \
|
||||
Telemetry::HTTP_##prefix##_DNS_ISSUE_TIME, \
|
||||
HISTOGRAM_TIME_DELTA(asyncOpen, domainLookupStart)); \
|
||||
asyncOpen, domainLookupStart); \
|
||||
} \
|
||||
\
|
||||
if (!domainLookupStart.IsNull() && !domainLookupEnd.IsNull()) { \
|
||||
Telemetry::Accumulate( \
|
||||
Telemetry::AccumulateTimeDelta( \
|
||||
Telemetry::HTTP_##prefix##_DNS_LOOKUP_TIME, \
|
||||
HISTOGRAM_TIME_DELTA(domainLookupStart, domainLookupEnd)); \
|
||||
domainLookupStart, domainLookupEnd); \
|
||||
} \
|
||||
\
|
||||
if (!connectStart.IsNull() && !connectEnd.IsNull()) { \
|
||||
Telemetry::Accumulate( \
|
||||
Telemetry::AccumulateTimeDelta( \
|
||||
Telemetry::HTTP_##prefix##_TCP_CONNECTION, \
|
||||
HISTOGRAM_TIME_DELTA(connectStart, connectEnd)); \
|
||||
connectStart, connectEnd); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
if (!requestStart.IsNull() && !responseEnd.IsNull()) { \
|
||||
Telemetry::Accumulate( \
|
||||
Telemetry::AccumulateTimeDelta( \
|
||||
Telemetry::HTTP_##prefix##_OPEN_TO_FIRST_SENT, \
|
||||
HISTOGRAM_TIME_DELTA(asyncOpen, requestStart)); \
|
||||
asyncOpen, requestStart); \
|
||||
\
|
||||
Telemetry::Accumulate( \
|
||||
Telemetry::AccumulateTimeDelta( \
|
||||
Telemetry::HTTP_##prefix##_FIRST_SENT_TO_LAST_RECEIVED, \
|
||||
HISTOGRAM_TIME_DELTA(requestStart, responseEnd)); \
|
||||
requestStart, responseEnd); \
|
||||
\
|
||||
if (cacheReadStart.IsNull() && !responseStart.IsNull()) { \
|
||||
Telemetry::Accumulate( \
|
||||
Telemetry::AccumulateTimeDelta( \
|
||||
Telemetry::HTTP_##prefix##_OPEN_TO_FIRST_RECEIVED, \
|
||||
HISTOGRAM_TIME_DELTA(asyncOpen, responseStart)); \
|
||||
asyncOpen, responseStart); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
if (!cacheReadStart.IsNull() && !cacheReadEnd.IsNull()) { \
|
||||
Telemetry::Accumulate( \
|
||||
Telemetry::AccumulateTimeDelta( \
|
||||
Telemetry::HTTP_##prefix##_OPEN_TO_FIRST_FROM_CACHE, \
|
||||
HISTOGRAM_TIME_DELTA(asyncOpen, cacheReadStart)); \
|
||||
asyncOpen, cacheReadStart); \
|
||||
\
|
||||
Telemetry::Accumulate( \
|
||||
Telemetry::AccumulateTimeDelta( \
|
||||
Telemetry::HTTP_##prefix##_CACHE_READ_TIME, \
|
||||
HISTOGRAM_TIME_DELTA(cacheReadStart, cacheReadEnd)); \
|
||||
cacheReadStart, cacheReadEnd); \
|
||||
\
|
||||
if (!requestStart.IsNull() && !responseEnd.IsNull()) { \
|
||||
Telemetry::Accumulate( \
|
||||
Telemetry::AccumulateTimeDelta( \
|
||||
Telemetry::HTTP_##prefix##_REVALIDATION, \
|
||||
HISTOGRAM_TIME_DELTA(requestStart, responseEnd)); \
|
||||
requestStart, responseEnd); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
if (!cacheReadEnd.IsNull()) { \
|
||||
Telemetry::Accumulate( \
|
||||
Telemetry::AccumulateTimeDelta( \
|
||||
Telemetry::HTTP_##prefix##_COMPLETE_LOAD, \
|
||||
HISTOGRAM_TIME_DELTA(asyncOpen, cacheReadEnd)); \
|
||||
Telemetry::Accumulate( \
|
||||
asyncOpen, cacheReadEnd); \
|
||||
Telemetry::AccumulateTimeDelta( \
|
||||
Telemetry::HTTP_##prefix##_COMPLETE_LOAD_CACHED, \
|
||||
HISTOGRAM_TIME_DELTA(asyncOpen, cacheReadEnd)); \
|
||||
asyncOpen, cacheReadEnd); \
|
||||
} \
|
||||
else if (!responseEnd.IsNull()) { \
|
||||
Telemetry::Accumulate( \
|
||||
Telemetry::AccumulateTimeDelta( \
|
||||
Telemetry::HTTP_##prefix##_COMPLETE_LOAD, \
|
||||
HISTOGRAM_TIME_DELTA(asyncOpen, responseEnd)); \
|
||||
Telemetry::Accumulate( \
|
||||
asyncOpen, responseEnd); \
|
||||
Telemetry::AccumulateTimeDelta( \
|
||||
Telemetry::HTTP_##prefix##_COMPLETE_LOAD_NET, \
|
||||
HISTOGRAM_TIME_DELTA(asyncOpen, responseEnd)); \
|
||||
asyncOpen, responseEnd); \
|
||||
}
|
||||
|
||||
if (aDefaultRequest) {
|
||||
|
@ -94,8 +94,8 @@ public:
|
||||
|
||||
~IOThreadAutoTimer() {
|
||||
PRUint32 mainThread = NS_IsMainThread() ? 1 : 0;
|
||||
Telemetry::Accumulate(static_cast<Telemetry::ID>(id + mainThread),
|
||||
(TimeStamp::Now() - start).ToMilliseconds());
|
||||
Telemetry::AccumulateTimeDelta(static_cast<Telemetry::ID>(id + mainThread),
|
||||
start);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
}
|
||||
|
||||
~AutoTimer() {
|
||||
Accumulate(id, static_cast<PRUint32>((TimeStamp::Now() - start).ToMilliseconds()));
|
||||
AccumulateTimeDelta(id, start);
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user