summaryrefslogtreecommitdiffstats
path: root/netwerk/protocol
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@wolfbeast.com>2019-01-14 20:21:16 +0100
committerGitHub <noreply@github.com>2019-01-14 20:21:16 +0100
commitfb1d4c9712eb1898d89f90edfc6120ff169e6357 (patch)
tree677d602abee695200146c4d51ba8db10146bc38c /netwerk/protocol
parentf38edc94a31de3bae839cf63ed57c3851908ac46 (diff)
parent6335404642a019df481275f4f290ea76b4d8f597 (diff)
downloadUXP-fb1d4c9712eb1898d89f90edfc6120ff169e6357.tar
UXP-fb1d4c9712eb1898d89f90edfc6120ff169e6357.tar.gz
UXP-fb1d4c9712eb1898d89f90edfc6120ff169e6357.tar.lz
UXP-fb1d4c9712eb1898d89f90edfc6120ff169e6357.tar.xz
UXP-fb1d4c9712eb1898d89f90edfc6120ff169e6357.zip
Merge pull request #929 from adeshkp/remove-telemetry-stubs
Telemetry: Remove stubs and related code
Diffstat (limited to 'netwerk/protocol')
-rw-r--r--netwerk/protocol/http/Http2Stream.cpp10
-rw-r--r--netwerk/protocol/http/HttpBaseChannel.cpp10
-rw-r--r--netwerk/protocol/http/nsHttpChannel.cpp55
-rw-r--r--netwerk/protocol/http/nsHttpChannel.h3
-rw-r--r--netwerk/protocol/http/nsHttpConnectionMgr.cpp48
-rw-r--r--netwerk/protocol/http/nsHttpConnectionMgr.h1
-rw-r--r--netwerk/protocol/http/nsHttpHandler.cpp16
-rw-r--r--netwerk/protocol/http/nsHttpHandler.h9
8 files changed, 6 insertions, 146 deletions
diff --git a/netwerk/protocol/http/Http2Stream.cpp b/netwerk/protocol/http/Http2Stream.cpp
index 3471985dd..581ebe016 100644
--- a/netwerk/protocol/http/Http2Stream.cpp
+++ b/netwerk/protocol/http/Http2Stream.cpp
@@ -657,12 +657,6 @@ Http2Stream::GenerateOpen()
outputOffset += frameLen;
}
- // The size of the input headers is approximate
- uint32_t ratio =
- compressedData.Length() * 100 /
- (11 + requestURI.Length() +
- mFlatHttpRequestHeaders.Length());
-
mFlatHttpRequestHeaders.Truncate();
return NS_OK;
}
@@ -980,7 +974,7 @@ Http2Stream::GenerateDataFrameHeader(uint32_t dataLength, bool lastFrame)
}
// ConvertResponseHeaders is used to convert the response headers
-// into HTTP/1 format and report some telemetry
+// into HTTP/1 format
nsresult
Http2Stream::ConvertResponseHeaders(Http2Decompressor *decompressor,
nsACString &aHeadersIn,
@@ -1036,7 +1030,7 @@ Http2Stream::ConvertResponseHeaders(Http2Decompressor *decompressor,
}
// ConvertPushHeaders is used to convert the pushed request headers
-// into HTTP/1 format and report some telemetry
+// into HTTP/1 format
nsresult
Http2Stream::ConvertPushHeaders(Http2Decompressor *decompressor,
nsACString &aHeadersIn,
diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp
index 21b661c2b..9e43d89e0 100644
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -996,16 +996,6 @@ HttpBaseChannel::DoApplyContentConversions(nsIStreamListener* aNextListener,
}
LOG(("converter removed '%s' content-encoding\n", val));
- if (gHttpHandler->IsTelemetryEnabled()) {
- int mode = 0;
- if (from.Equals("gzip") || from.Equals("x-gzip")) {
- mode = 1;
- } else if (from.Equals("deflate") || from.Equals("x-deflate")) {
- mode = 2;
- } else if (from.Equals("br")) {
- mode = 3;
- }
- }
nextListener = converter;
}
else {
diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
index be5539a02..a890c51b3 100644
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -83,7 +83,6 @@
#include "nsCRT.h"
#include "CacheObserver.h"
#include "mozilla/dom/Performance.h"
-#include "mozilla/Telemetry.h"
#include "AlternateServices.h"
#include "InterceptedChannel.h"
#include "nsIHttpPushListener.h"
@@ -123,19 +122,6 @@ static NS_DEFINE_CID(kStreamListenerTeeCID, NS_STREAMLISTENERTEE_CID);
static NS_DEFINE_CID(kStreamTransportServiceCID,
NS_STREAMTRANSPORTSERVICE_CID);
-enum CacheDisposition {
- kCacheHit = 1,
- kCacheHitViaReval = 2,
- kCacheMissedViaReval = 3,
- kCacheMissed = 4
-};
-
-void
-AccumulateCacheHitTelemetry(CacheDisposition hitOrMiss)
-{
- /* STUB */
-}
-
// Computes and returns a SHA1 hash of the input buffer. The input buffer
// must be a null-terminated string.
nsresult
@@ -494,11 +480,6 @@ nsHttpChannel::ContinueConnect()
event->Revoke();
}
- // Don't accumulate the cache hit telemetry for intercepted channels.
- if (mInterceptCache != INTERCEPTED) {
- AccumulateCacheHitTelemetry(kCacheHit);
- }
-
return rv;
}
else if (mLoadFlags & LOAD_ONLY_FROM_CACHE) {
@@ -1085,10 +1066,8 @@ ProcessXCTO(nsIURI* aURI, nsHttpResponseHead* aResponseHead, nsILoadInfo* aLoadI
if (aLoadInfo->GetExternalContentPolicyType() == nsIContentPolicy::TYPE_IMAGE) {
if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("image/"))) {
- Accumulate(Telemetry::XCTO_NOSNIFF_BLOCK_IMAGE, 0);
return NS_OK;
}
- Accumulate(Telemetry::XCTO_NOSNIFF_BLOCK_IMAGE, 1);
// Instead of consulting Preferences::GetBool() all the time we
// can cache the result to speed things up.
static bool sXCTONosniffBlockImages = false;
@@ -2116,29 +2095,6 @@ nsHttpChannel::ContinueProcessResponse2(nsresult rv)
break;
}
- if (gHttpHandler->IsTelemetryEnabled()) {
- CacheDisposition cacheDisposition;
- if (!mDidReval) {
- cacheDisposition = kCacheMissed;
- } else if (successfulReval) {
- cacheDisposition = kCacheHitViaReval;
- } else {
- cacheDisposition = kCacheMissedViaReval;
- }
- AccumulateCacheHitTelemetry(cacheDisposition);
-
- if (mResponseHead->Version() == NS_HTTP_VERSION_0_9) {
- // DefaultPortTopLevel = 0, DefaultPortSubResource = 1,
- // NonDefaultPortTopLevel = 2, NonDefaultPortSubResource = 3
- uint32_t v09Info = 0;
- if (!(mLoadFlags & LOAD_INITIAL_DOCUMENT_URI)) {
- v09Info += 1;
- }
- if (mConnectionInfo->OriginPort() != mConnectionInfo->DefaultPort()) {
- v09Info += 2;
- }
- }
- }
return rv;
}
@@ -3784,8 +3740,6 @@ nsHttpChannel::OnCacheEntryCheck(nsICacheEntry* entry, nsIApplicationCache* appC
(!mCachedResponseHead->ExpiresInPast() ||
!mCachedResponseHead->MustValidateIfExpired())) {
LOG(("NOT validating based on isForcedValid being true.\n"));
- Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PREFETCHES_USED> used;
- ++used;
doValidation = false;
}
// If the LOAD_FROM_CACHE flag is set, any cached data can simply be used
@@ -6546,8 +6500,6 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult st
if (mTimingEnabled && request == mCachePump) {
mCacheReadEnd = TimeStamp::Now();
-
- ReportNetVSCacheTelemetry();
}
// allow content to be cached if it was loaded successfully (bug #482935)
@@ -8104,12 +8056,5 @@ nsHttpChannel::SetDoNotTrack()
}
}
-
-void
-nsHttpChannel::ReportNetVSCacheTelemetry()
-{
- /* STUB */
-}
-
} // namespace net
} // namespace mozilla
diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h
index 152cf1503..554875b1c 100644
--- a/netwerk/protocol/http/nsHttpChannel.h
+++ b/netwerk/protocol/http/nsHttpChannel.h
@@ -431,9 +431,6 @@ private:
rv == NS_ERROR_MALFORMED_URI;
}
- // Report net vs cache time telemetry
- void ReportNetVSCacheTelemetry();
-
// Create a aggregate set of the current notification callbacks
// and ensure the transaction is updated to use it.
void UpdateAggregateCallbacks();
diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
index 731cdff39..907f33436 100644
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -35,8 +35,6 @@
#include "mozilla/Unused.h"
#include "nsIURI.h"
-#include "mozilla/Telemetry.h"
-
namespace mozilla {
namespace net {
@@ -1186,14 +1184,6 @@ nsHttpConnectionMgr::MakeNewConnection(nsConnectionEntry *ent,
transport->SetConnectionFlags(flags);
}
- Telemetry::AutoCounter<Telemetry::HTTPCONNMGR_USED_SPECULATIVE_CONN> usedSpeculativeConn;
- ++usedSpeculativeConn;
-
- if (ent->mHalfOpens[i]->IsFromPredictor()) {
- Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PRECONNECTS_USED> totalPreconnectsUsed;
- ++totalPreconnectsUsed;
- }
-
// return OK because we have essentially opened a new connection
// by converting a speculative half-open to general use
return NS_OK;
@@ -1387,14 +1377,6 @@ nsHttpConnectionMgr::AddToShortestPipeline(nsConnectionEntry *ent,
ent->SetYellowConnection(bestConn);
if (!trans->GetPendingTime().IsNull()) {
- if (trans->UsesPipelining())
- AccumulateTimeDelta(
- Telemetry::TRANSACTION_WAIT_TIME_HTTP_PIPELINES,
- trans->GetPendingTime(), TimeStamp::Now());
- else
- AccumulateTimeDelta(
- Telemetry::TRANSACTION_WAIT_TIME_HTTP,
- trans->GetPendingTime(), TimeStamp::Now());
trans->SetPendingTime(false);
}
return true;
@@ -1677,8 +1659,6 @@ nsHttpConnectionMgr::DispatchTransaction(nsConnectionEntry *ent,
rv = conn->Activate(trans, caps, priority);
MOZ_ASSERT(NS_SUCCEEDED(rv), "SPDY Cannot Fail Dispatch");
if (NS_SUCCEEDED(rv) && !trans->GetPendingTime().IsNull()) {
- AccumulateTimeDelta(Telemetry::TRANSACTION_WAIT_TIME_SPDY,
- trans->GetPendingTime(), TimeStamp::Now());
trans->SetPendingTime(false);
}
return rv;
@@ -1695,12 +1675,6 @@ nsHttpConnectionMgr::DispatchTransaction(nsConnectionEntry *ent,
rv = DispatchAbstractTransaction(ent, trans, caps, conn, priority);
if (NS_SUCCEEDED(rv) && !trans->GetPendingTime().IsNull()) {
- if (trans->UsesPipelining())
- AccumulateTimeDelta(Telemetry::TRANSACTION_WAIT_TIME_HTTP_PIPELINES,
- trans->GetPendingTime(), TimeStamp::Now());
- else
- AccumulateTimeDelta(Telemetry::TRANSACTION_WAIT_TIME_HTTP,
- trans->GetPendingTime(), TimeStamp::Now());
trans->SetPendingTime(false);
}
return rv;
@@ -1829,12 +1803,6 @@ nsHttpConnectionMgr::BuildPipeline(nsConnectionEntry *ent,
return NS_OK;
}
-void
-nsHttpConnectionMgr::ReportProxyTelemetry(nsConnectionEntry *ent)
-{
- /* STUB */
-}
-
nsresult
nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans)
{
@@ -1878,8 +1846,6 @@ nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans)
ent = preferredEntry;
}
- ReportProxyTelemetry(ent);
-
// Check if the transaction already has a sticky reference to a connection.
// If so, then we can just use it directly by transferring its reference
// to the new connection variable instead of searching for a new one
@@ -1976,13 +1942,9 @@ nsHttpConnectionMgr::CreateTransport(nsConnectionEntry *ent,
if (speculative) {
sock->SetSpeculative(true);
sock->SetAllow1918(allow1918);
- Telemetry::AutoCounter<Telemetry::HTTPCONNMGR_TOTAL_SPECULATIVE_CONN> totalSpeculativeConn;
- ++totalSpeculativeConn;
if (isFromPredictor) {
sock->SetIsFromPredictor(true);
- Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PRECONNECTS_CREATED> totalPreconnectsCreated;
- ++totalPreconnectsCreated;
}
}
@@ -3894,16 +3856,6 @@ nsConnectionEntry::RemoveHalfOpen(nsHalfOpenSocket *halfOpen)
// will result in it not being present in the halfopen table. That's expected.
if (mHalfOpens.RemoveElement(halfOpen)) {
- if (halfOpen->IsSpeculative()) {
- Telemetry::AutoCounter<Telemetry::HTTPCONNMGR_UNUSED_SPECULATIVE_CONN> unusedSpeculativeConn;
- ++unusedSpeculativeConn;
-
- if (halfOpen->IsFromPredictor()) {
- Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PRECONNECTS_UNUSED> totalPreconnectsUnused;
- ++totalPreconnectsUnused;
- }
- }
-
MOZ_ASSERT(gHttpHandler->ConnMgr()->mNumHalfOpenConns);
if (gHttpHandler->ConnMgr()->mNumHalfOpenConns) { // just in case
gHttpHandler->ConnMgr()->mNumHalfOpenConns--;
diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.h b/netwerk/protocol/http/nsHttpConnectionMgr.h
index 7ca2a2b28..a2c88c402 100644
--- a/netwerk/protocol/http/nsHttpConnectionMgr.h
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.h
@@ -529,7 +529,6 @@ private:
nsresult ProcessNewTransaction(nsHttpTransaction *);
nsresult EnsureSocketThreadTarget();
void ClosePersistentConnections(nsConnectionEntry *ent);
- void ReportProxyTelemetry(nsConnectionEntry *ent);
nsresult CreateTransport(nsConnectionEntry *, nsAHttpTransaction *,
uint32_t, bool, bool, bool);
void AddActiveConn(nsHttpConnection *, nsConnectionEntry *);
diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp
index 6d58a7004..477961454 100644
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -90,7 +90,6 @@
#define BROWSER_PREF_PREFIX "browser.cache."
#define DONOTTRACK_HEADER_ENABLED "privacy.donottrackheader.enabled"
#define H2MANDATORY_SUITE "security.ssl3.ecdhe_rsa_aes_128_gcm_sha256"
-#define TELEMETRY_ENABLED "toolkit.telemetry.enabled"
#define ALLOW_EXPERIMENTS "network.allow-experiments"
#define SAFE_HINT_HEADER_VALUE "safeHint.enabled"
#define SECURITY_PREFIX "security."
@@ -209,7 +208,6 @@ nsHttpHandler::nsHttpHandler()
, mSafeHintEnabled(false)
, mParentalControlEnabled(false)
, mHandlerActive(false)
- , mTelemetryEnabled(false)
, mAllowExperiments(true)
, mDebugObservations(false)
, mEnableSpdy(false)
@@ -305,7 +303,6 @@ nsHttpHandler::Init()
prefBranch->AddObserver(INTL_ACCEPT_LANGUAGES, this, true);
prefBranch->AddObserver(BROWSER_PREF("disk_cache_ssl"), this, true);
prefBranch->AddObserver(DONOTTRACK_HEADER_ENABLED, this, true);
- prefBranch->AddObserver(TELEMETRY_ENABLED, this, true);
prefBranch->AddObserver(H2MANDATORY_SUITE, this, true);
prefBranch->AddObserver(HTTP_PREF("tcp_keepalive.short_lived_connections"), this, true);
prefBranch->AddObserver(HTTP_PREF("tcp_keepalive.long_lived_connections"), this, true);
@@ -1547,19 +1544,6 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
// includes telemetry and allow-experiments because of the abtest profile
bool requestTokenBucketUpdated = false;
- //
- // Telemetry
- //
-
- if (PREF_CHANGED(TELEMETRY_ENABLED)) {
- cVar = false;
- requestTokenBucketUpdated = true;
- rv = prefs->GetBoolPref(TELEMETRY_ENABLED, &cVar);
- if (NS_SUCCEEDED(rv)) {
- mTelemetryEnabled = cVar;
- }
- }
-
// "security.ssl3.ecdhe_rsa_aes_128_gcm_sha256" is the required h2 interop
// suite.
diff --git a/netwerk/protocol/http/nsHttpHandler.h b/netwerk/protocol/http/nsHttpHandler.h
index 848dd25b1..f1ec0f947 100644
--- a/netwerk/protocol/http/nsHttpHandler.h
+++ b/netwerk/protocol/http/nsHttpHandler.h
@@ -105,8 +105,10 @@ public:
bool EnforceAssocReq() { return mEnforceAssocReq; }
bool IsPersistentHttpsCachingEnabled() { return mEnablePersistentHttpsCaching; }
- bool IsTelemetryEnabled() { return mTelemetryEnabled; }
- bool AllowExperiments() { return mTelemetryEnabled && mAllowExperiments; }
+
+ // Since telemetry has been removed, experiments should also not be allowed.
+ // Making this function return `false` for now, it will be cleaned up later.
+ bool AllowExperiments() { return false; }
bool IsSpdyEnabled() { return mEnableSpdy; }
bool IsHttp2Enabled() { return mHttp2Enabled; }
@@ -509,9 +511,6 @@ private:
// true in between init and shutdown states
Atomic<bool, Relaxed> mHandlerActive;
- // Whether telemetry is reported or not
- uint32_t mTelemetryEnabled : 1;
-
// The value of network.allow-experiments
uint32_t mAllowExperiments : 1;