summaryrefslogtreecommitdiffstats
path: root/netwerk/base/nsLoadGroup.cpp
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-09-03 18:26:19 +0200
committerGitHub <noreply@github.com>2018-09-03 18:26:19 +0200
commit2e00eb87ef299e6eb7521670e6a6720fee19f5fc (patch)
treec44670a25d942a672951e430499f70978ec7d337 /netwerk/base/nsLoadGroup.cpp
parent45f9a0daad81d1c6a1188b3473e5f0c67d27c0aa (diff)
parentab961aeb54335fd07c66de2e3b8c3b6af6f89ea2 (diff)
downloadUXP-2e00eb87ef299e6eb7521670e6a6720fee19f5fc.tar
UXP-2e00eb87ef299e6eb7521670e6a6720fee19f5fc.tar.gz
UXP-2e00eb87ef299e6eb7521670e6a6720fee19f5fc.tar.lz
UXP-2e00eb87ef299e6eb7521670e6a6720fee19f5fc.tar.xz
UXP-2e00eb87ef299e6eb7521670e6a6720fee19f5fc.zip
Merge pull request #745 from MoonchildProductions/Kill-Telemetry
Remove all C++ Telemetry Accumulation calls.
Diffstat (limited to 'netwerk/base/nsLoadGroup.cpp')
-rw-r--r--netwerk/base/nsLoadGroup.cpp159
1 files changed, 1 insertions, 158 deletions
diff --git a/netwerk/base/nsLoadGroup.cpp b/netwerk/base/nsLoadGroup.cpp
index 51d5a9ca7..9981bd698 100644
--- a/netwerk/base/nsLoadGroup.cpp
+++ b/netwerk/base/nsLoadGroup.cpp
@@ -14,7 +14,6 @@
#include "mozilla/Logging.h"
#include "nsString.h"
#include "nsTArray.h"
-#include "mozilla/Telemetry.h"
#include "nsITimedChannel.h"
#include "nsIInterfaceRequestor.h"
#include "nsIRequestObserver.h"
@@ -574,40 +573,6 @@ nsLoadGroup::RemoveRequest(nsIRequest *request, nsISupports* ctxt,
mRequests.RemoveEntry(entry);
- // Collect telemetry stats only when default request is a timed channel.
- // Don't include failed requests in the timing statistics.
- if (mDefaultLoadIsTimed && NS_SUCCEEDED(aStatus)) {
- nsCOMPtr<nsITimedChannel> timedChannel = do_QueryInterface(request);
- if (timedChannel) {
- // Figure out if this request was served from the cache
- ++mTimedRequests;
- TimeStamp timeStamp;
- rv = timedChannel->GetCacheReadStart(&timeStamp);
- if (NS_SUCCEEDED(rv) && !timeStamp.IsNull()) {
- ++mCachedRequests;
- }
- else {
- mTimedNonCachedRequestsUntilOnEndPageLoad++;
- }
-
- rv = timedChannel->GetAsyncOpen(&timeStamp);
- if (NS_SUCCEEDED(rv) && !timeStamp.IsNull()) {
- Telemetry::AccumulateTimeDelta(
- Telemetry::HTTP_SUBITEM_OPEN_LATENCY_TIME,
- mDefaultRequestCreationTime, timeStamp);
- }
-
- rv = timedChannel->GetResponseStart(&timeStamp);
- if (NS_SUCCEEDED(rv) && !timeStamp.IsNull()) {
- Telemetry::AccumulateTimeDelta(
- Telemetry::HTTP_SUBITEM_FIRST_BYTE_LATENCY_TIME,
- mDefaultRequestCreationTime, timeStamp);
- }
-
- TelemetryReportChannel(timedChannel, false);
- }
- }
-
if (mRequests.EntryCount() == 0) {
TelemetryReport();
}
@@ -815,19 +780,7 @@ nsLoadGroup::SetDefaultLoadFlags(uint32_t aFlags)
void
nsLoadGroup::TelemetryReport()
{
- if (mDefaultLoadIsTimed) {
- Telemetry::Accumulate(Telemetry::HTTP_REQUEST_PER_PAGE, mTimedRequests);
- if (mTimedRequests) {
- Telemetry::Accumulate(Telemetry::HTTP_REQUEST_PER_PAGE_FROM_CACHE,
- mCachedRequests * 100 / mTimedRequests);
- }
-
- nsCOMPtr<nsITimedChannel> timedChannel =
- do_QueryInterface(mDefaultLoadRequest);
- if (timedChannel)
- TelemetryReportChannel(timedChannel, true);
- }
-
+ /* STUB */
mTimedRequests = 0;
mCachedRequests = 0;
mDefaultLoadIsTimed = false;
@@ -898,116 +851,6 @@ nsLoadGroup::TelemetryReportChannel(nsITimedChannel *aTimedChannel,
rv = aTimedChannel->GetResponseEnd(&responseEnd);
if (NS_FAILED(rv))
return;
-
-#define HTTP_REQUEST_HISTOGRAMS(prefix) \
- if (!domainLookupStart.IsNull()) { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_DNS_ISSUE_TIME, \
- asyncOpen, domainLookupStart); \
- } \
- \
- if (!domainLookupStart.IsNull() && !domainLookupEnd.IsNull()) { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_DNS_LOOKUP_TIME, \
- domainLookupStart, domainLookupEnd); \
- } \
- \
- if (!secureConnectionStart.IsNull() && !connectEnd.IsNull()) { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_TLS_HANDSHAKE, \
- secureConnectionStart, connectEnd); \
- } \
- \
- if (!connectStart.IsNull() && !connectEnd.IsNull()) { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_TCP_CONNECTION_2, \
- connectStart, connectEnd); \
- } \
- \
- \
- if (!requestStart.IsNull() && !responseEnd.IsNull()) { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_OPEN_TO_FIRST_SENT, \
- asyncOpen, requestStart); \
- \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_FIRST_SENT_TO_LAST_RECEIVED, \
- requestStart, responseEnd); \
- \
- if (cacheReadStart.IsNull() && !responseStart.IsNull()) { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_OPEN_TO_FIRST_RECEIVED, \
- asyncOpen, responseStart); \
- } \
- } \
- \
- if (!cacheReadStart.IsNull() && !cacheReadEnd.IsNull()) { \
- if (!CacheObserver::UseNewCache()) { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_OPEN_TO_FIRST_FROM_CACHE, \
- asyncOpen, cacheReadStart); \
- } else { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_OPEN_TO_FIRST_FROM_CACHE_V2, \
- asyncOpen, cacheReadStart); \
- } \
- \
- if (!CacheObserver::UseNewCache()) { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_CACHE_READ_TIME, \
- cacheReadStart, cacheReadEnd); \
- } else { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_CACHE_READ_TIME_V2, \
- cacheReadStart, cacheReadEnd); \
- } \
- \
- if (!requestStart.IsNull() && !responseEnd.IsNull()) { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_REVALIDATION, \
- requestStart, responseEnd); \
- } \
- } \
- \
- if (!cacheReadEnd.IsNull()) { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_COMPLETE_LOAD, \
- asyncOpen, cacheReadEnd); \
- \
- if (!CacheObserver::UseNewCache()) { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_COMPLETE_LOAD_CACHED, \
- asyncOpen, cacheReadEnd); \
- } else { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_COMPLETE_LOAD_CACHED_V2, \
- asyncOpen, cacheReadEnd); \
- } \
- } \
- else if (!responseEnd.IsNull()) { \
- if (!CacheObserver::UseNewCache()) { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_COMPLETE_LOAD, \
- asyncOpen, responseEnd); \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_COMPLETE_LOAD_NET, \
- asyncOpen, responseEnd); \
- } else { \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_COMPLETE_LOAD_V2, \
- asyncOpen, responseEnd); \
- Telemetry::AccumulateTimeDelta( \
- Telemetry::HTTP_##prefix##_COMPLETE_LOAD_NET_V2, \
- asyncOpen, responseEnd); \
- } \
- }
-
- if (aDefaultRequest) {
- HTTP_REQUEST_HISTOGRAMS(PAGE)
- } else {
- HTTP_REQUEST_HISTOGRAMS(SUB)
- }
-#undef HTTP_REQUEST_HISTOGRAMS
}
nsresult nsLoadGroup::MergeLoadFlags(nsIRequest *aRequest,