diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-09-03 10:11:38 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-09-03 10:11:38 +0200 |
commit | ab961aeb54335fd07c66de2e3b8c3b6af6f89ea2 (patch) | |
tree | c44670a25d942a672951e430499f70978ec7d337 /netwerk | |
parent | 45f9a0daad81d1c6a1188b3473e5f0c67d27c0aa (diff) | |
download | uxp-ab961aeb54335fd07c66de2e3b8c3b6af6f89ea2.tar.gz |
Remove all C++ Telemetry Accumulation calls.
This creates a number of stubs and leaves some surrounding code that may be irrelevant (eg. recorded time stamps, status variables).
Stub resolution/removal should be a follow-up to this.
Diffstat (limited to 'netwerk')
34 files changed, 8 insertions, 835 deletions
diff --git a/netwerk/base/BackgroundFileSaver.cpp b/netwerk/base/BackgroundFileSaver.cpp index e4bc058262..cfe94e35ba 100644 --- a/netwerk/base/BackgroundFileSaver.cpp +++ b/netwerk/base/BackgroundFileSaver.cpp @@ -798,8 +798,6 @@ BackgroundFileSaver::NotifySaveComplete() // during the session in a telemetry histogram, and we reset the maximum // thread counter for the next download session if (sThreadCount == 0) { - Telemetry::Accumulate(Telemetry::BACKGROUNDFILESAVER_THREAD_COUNT, - sTelemetryMaxThreadCount); sTelemetryMaxThreadCount = 0; } diff --git a/netwerk/base/Predictor.cpp b/netwerk/base/Predictor.cpp index e97b11d162..12e4eb4155 100644 --- a/netwerk/base/Predictor.cpp +++ b/netwerk/base/Predictor.cpp @@ -294,26 +294,9 @@ Predictor::Action::OnCacheEntryAvailable(nsICacheEntry *entry, bool isNew, "Aborting.", this, result)); return NS_OK; } - Telemetry::AccumulateTimeDelta(Telemetry::PREDICTOR_WAIT_TIME, - mStartTime); - if (mPredict) { - bool predicted = mPredictor->PredictInternal(mPredictReason, entry, isNew, - mFullUri, mTargetURI, - mVerifier, mStackCount); - Telemetry::AccumulateTimeDelta( - Telemetry::PREDICTOR_PREDICT_WORK_TIME, mStartTime); - if (predicted) { - Telemetry::AccumulateTimeDelta( - Telemetry::PREDICTOR_PREDICT_TIME_TO_ACTION, mStartTime); - } else { - Telemetry::AccumulateTimeDelta( - Telemetry::PREDICTOR_PREDICT_TIME_TO_INACTION, mStartTime); - } - } else { + if (!mPredict) { mPredictor->LearnInternal(mLearnReason, entry, isNew, mFullUri, mTargetURI, mSourceURI); - Telemetry::AccumulateTimeDelta( - Telemetry::PREDICTOR_LEARN_WORK_TIME, mStartTime); } return NS_OK; @@ -1073,8 +1056,6 @@ Predictor::CalculateGlobalDegradation(uint32_t lastLoad) globalDegradation = mPageDegradationMax; } - Telemetry::Accumulate(Telemetry::PREDICTOR_GLOBAL_DEGRADATION, - globalDegradation); return globalDegradation; } @@ -1139,10 +1120,6 @@ Predictor::CalculateConfidence(uint32_t hitCount, uint32_t hitsPossible, confidence = std::max(confidence, 0); confidence = std::min(confidence, maxConfidence); - Telemetry::Accumulate(Telemetry::PREDICTOR_BASE_CONFIDENCE, baseConfidence); - Telemetry::Accumulate(Telemetry::PREDICTOR_SUBRESOURCE_DEGRADATION, - confidenceDegradation); - Telemetry::Accumulate(Telemetry::PREDICTOR_CONFIDENCE, confidence); return confidence; } @@ -2335,7 +2312,6 @@ Predictor::PrefetchListener::OnStopRequest(nsIRequest *aRequest, if (NS_FAILED(aStatusCode)) { return aStatusCode; } - Telemetry::AccumulateTimeDelta(Telemetry::PREDICTOR_PREFETCH_TIME, mStartTime); nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aRequest); if (!httpChannel) { diff --git a/netwerk/base/nsLoadGroup.cpp b/netwerk/base/nsLoadGroup.cpp index 51d5a9ca7e..9981bd6989 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, diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp index d60c909c52..653a9003ee 100644 --- a/netwerk/base/nsNetUtil.cpp +++ b/netwerk/base/nsNetUtil.cpp @@ -2262,7 +2262,6 @@ NS_ShouldSecureUpgrade(nsIURI* aURI, nsIScriptError::warningFlag, "CSP", innerWindowId); - Telemetry::Accumulate(Telemetry::HTTP_SCHEME_UPGRADE, 4); aShouldUpgrade = true; return NS_OK; } @@ -2285,17 +2284,10 @@ NS_ShouldSecureUpgrade(nsIURI* aURI, if (isStsHost) { LOG(("nsHttpChannel::Connect() STS permissions found\n")); if (aAllowSTS) { - Telemetry::Accumulate(Telemetry::HTTP_SCHEME_UPGRADE, 3); aShouldUpgrade = true; return NS_OK; - } else { - Telemetry::Accumulate(Telemetry::HTTP_SCHEME_UPGRADE, 2); } - } else { - Telemetry::Accumulate(Telemetry::HTTP_SCHEME_UPGRADE, 1); } - } else { - Telemetry::Accumulate(Telemetry::HTTP_SCHEME_UPGRADE, 0); } aShouldUpgrade = false; return NS_OK; diff --git a/netwerk/base/nsSocketTransport2.cpp b/netwerk/base/nsSocketTransport2.cpp index 184757d33c..f9b55ead4d 100644 --- a/netwerk/base/nsSocketTransport2.cpp +++ b/netwerk/base/nsSocketTransport2.cpp @@ -1596,17 +1596,6 @@ nsSocketTransport::RecoverFromError() bool tryAgain = false; - if ((mState == STATE_CONNECTING) && mDNSRecord && - mSocketTransportService->IsTelemetryEnabledAndNotSleepPhase()) { - if (mNetAddr.raw.family == AF_INET) { - Telemetry::Accumulate(Telemetry::IPV4_AND_IPV6_ADDRESS_CONNECTIVITY, - UNSUCCESSFUL_CONNECTING_TO_IPV4_ADDRESS); - } else if (mNetAddr.raw.family == AF_INET6) { - Telemetry::Accumulate(Telemetry::IPV4_AND_IPV6_ADDRESS_CONNECTIVITY, - UNSUCCESSFUL_CONNECTING_TO_IPV6_ADDRESS); - } - } - if (mConnectionFlags & (DISABLE_IPV6 | DISABLE_IPV4) && mCondition == NS_ERROR_UNKNOWN_HOST && mState == STATE_RESOLVING && @@ -1996,18 +1985,6 @@ nsSocketTransport::OnSocketReady(PRFileDesc *fd, int16_t outFlags) // we are connected! // OnSocketConnected(); - - if (mSocketTransportService->IsTelemetryEnabledAndNotSleepPhase()) { - if (mNetAddr.raw.family == AF_INET) { - Telemetry::Accumulate( - Telemetry::IPV4_AND_IPV6_ADDRESS_CONNECTIVITY, - SUCCESSFUL_CONNECTING_TO_IPV4_ADDRESS); - } else if (mNetAddr.raw.family == AF_INET6) { - Telemetry::Accumulate( - Telemetry::IPV4_AND_IPV6_ADDRESS_CONNECTIVITY, - SUCCESSFUL_CONNECTING_TO_IPV6_ADDRESS); - } - } } else { PRErrorCode code = PR_GetError(); @@ -3201,28 +3178,7 @@ nsSocketTransport::SendPRBlockingTelemetry(PRIntervalTime aStart, Telemetry::ID aIDLinkChange, Telemetry::ID aIDOffline) { - PRIntervalTime now = PR_IntervalNow(); - if (gIOService->IsNetTearingDown()) { - Telemetry::Accumulate(aIDShutdown, - PR_IntervalToMilliseconds(now - aStart)); - - } else if (PR_IntervalToSeconds(now - gIOService->LastConnectivityChange()) - < 60) { - Telemetry::Accumulate(aIDConnectivityChange, - PR_IntervalToMilliseconds(now - aStart)); - } else if (PR_IntervalToSeconds(now - gIOService->LastNetworkLinkChange()) - < 60) { - Telemetry::Accumulate(aIDLinkChange, - PR_IntervalToMilliseconds(now - aStart)); - - } else if (PR_IntervalToSeconds(now - gIOService->LastOfflineStateChange()) - < 60) { - Telemetry::Accumulate(aIDOffline, - PR_IntervalToMilliseconds(now - aStart)); - } else { - Telemetry::Accumulate(aIDNormal, - PR_IntervalToMilliseconds(now - aStart)); - } + /* STUB */ } } // namespace net diff --git a/netwerk/base/nsSocketTransportService2.cpp b/netwerk/base/nsSocketTransportService2.cpp index 068bf0eca9..72afdc9e19 100644 --- a/netwerk/base/nsSocketTransportService2.cpp +++ b/netwerk/base/nsSocketTransportService2.cpp @@ -219,7 +219,6 @@ nsSocketTransportService::CanAttachSocket() if (mTelemetryEnabledPref && (((total >= 900) || !rv) && !reported900FDLimit)) { reported900FDLimit = true; - Telemetry::Accumulate(Telemetry::NETWORK_SESSION_AT_900FD, true); } return rv; @@ -898,16 +897,6 @@ nsSocketTransportService::Run() DoPollIteration(&singlePollDuration); - if (mTelemetryEnabledPref && !pollCycleStart.IsNull()) { - Telemetry::Accumulate(Telemetry::STS_POLL_BLOCK_TIME, - singlePollDuration.ToMilliseconds()); - Telemetry::AccumulateTimeDelta( - Telemetry::STS_POLL_CYCLE, - pollCycleStart + singlePollDuration, - TimeStamp::NowLoRes()); - pollDuration += singlePollDuration; - } - mRawThread->HasPendingEvents(&pendingEvents); if (pendingEvents) { if (!mServingPendingQueue) { @@ -940,22 +929,6 @@ nsSocketTransportService::Run() ((TimeStamp::NowLoRes() - eventQueueStart).ToMilliseconds() < mMaxTimePerPollIter)); - - if (mTelemetryEnabledPref && !mServingPendingQueue && - !startOfIteration.IsNull()) { - Telemetry::AccumulateTimeDelta( - Telemetry::STS_POLL_AND_EVENTS_CYCLE, - startOfIteration + pollDuration, - TimeStamp::NowLoRes()); - - Telemetry::Accumulate( - Telemetry::STS_NUMBER_OF_PENDING_EVENTS, - numberOfPendingEvents); - - numberOfPendingEventsLastCycle += numberOfPendingEvents; - numberOfPendingEvents = 0; - pollDuration = 0; - } } } while (pendingEvents); @@ -964,16 +937,6 @@ nsSocketTransportService::Run() { MutexAutoLock lock(mLock); if (mShuttingDown) { - if (mTelemetryEnabledPref && - !startOfCycleForLastCycleCalc.IsNull()) { - Telemetry::Accumulate( - Telemetry::STS_NUMBER_OF_PENDING_EVENTS_IN_THE_LAST_CYCLE, - numberOfPendingEventsLastCycle); - Telemetry::AccumulateTimeDelta( - Telemetry::STS_POLL_AND_EVENT_THE_LAST_CYCLE, - startOfCycleForLastCycleCalc, - TimeStamp::NowLoRes()); - } break; } if (mGoingOffline) { @@ -1142,11 +1105,6 @@ nsSocketTransportService::DoPollIteration(TimeDuration *pollDuration) } } } - if (mTelemetryEnabledPref) { - Telemetry::Accumulate( - Telemetry::STS_NUMBER_OF_ONSOCKETREADY_CALLS, - numberOfOnSocketReadyCalls); - } // // check for "dead" sockets and remove them (need to do this in @@ -1465,7 +1423,6 @@ nsSocketTransportService::ProbeMaxCount() if (pfd[index].fd) PR_Close(pfd[index].fd); - Telemetry::Accumulate(Telemetry::NETWORK_PROBE_MAXCOUNT, gMaxCount); SOCKET_LOG(("Socket Limit Test max was confirmed at %d\n", gMaxCount)); } #endif // windows diff --git a/netwerk/base/nsUDPSocket.cpp b/netwerk/base/nsUDPSocket.cpp index 5973a205d4..24f3954cb5 100644 --- a/netwerk/base/nsUDPSocket.cpp +++ b/netwerk/base/nsUDPSocket.cpp @@ -777,33 +777,6 @@ nsUDPSocket::CloseSocket() } PR_Close(mFD); - - if (gSocketTransportService->IsTelemetryEnabledAndNotSleepPhase()) { - PRIntervalTime now = PR_IntervalNow(); - if (gIOService->IsNetTearingDown()) { - Telemetry::Accumulate(Telemetry::PRCLOSE_UDP_BLOCKING_TIME_SHUTDOWN, - PR_IntervalToMilliseconds(now - closeStarted)); - - } else if (PR_IntervalToSeconds(now - gIOService->LastConnectivityChange()) - < 60) { - Telemetry::Accumulate(Telemetry::PRCLOSE_UDP_BLOCKING_TIME_CONNECTIVITY_CHANGE, - PR_IntervalToMilliseconds(now - closeStarted)); - - } else if (PR_IntervalToSeconds(now - gIOService->LastNetworkLinkChange()) - < 60) { - Telemetry::Accumulate(Telemetry::PRCLOSE_UDP_BLOCKING_TIME_LINK_CHANGE, - PR_IntervalToMilliseconds(now - closeStarted)); - - } else if (PR_IntervalToSeconds(now - gIOService->LastOfflineStateChange()) - < 60) { - Telemetry::Accumulate(Telemetry::PRCLOSE_UDP_BLOCKING_TIME_OFFLINE, - PR_IntervalToMilliseconds(now - closeStarted)); - - } else { - Telemetry::Accumulate(Telemetry::PRCLOSE_UDP_BLOCKING_TIME_NORMAL, - PR_IntervalToMilliseconds(now - closeStarted)); - } - } } mFD = nullptr; } diff --git a/netwerk/cache/nsCacheService.cpp b/netwerk/cache/nsCacheService.cpp index bab67e1040..7c977c09d4 100644 --- a/netwerk/cache/nsCacheService.cpp +++ b/netwerk/cache/nsCacheService.cpp @@ -2655,18 +2655,7 @@ nsCacheService::Lock(mozilla::Telemetry::ID mainThreadLockerID) generalID = mozilla::Telemetry::CACHE_SERVICE_LOCK_WAIT_2; } - TimeStamp start(TimeStamp::Now()); - nsCacheService::Lock(); - - TimeStamp stop(TimeStamp::Now()); - - // Telemetry isn't thread safe on its own, but this is OK because we're - // protecting it with the cache lock. - if (lockerID != mozilla::Telemetry::HistogramCount) { - mozilla::Telemetry::AccumulateTimeDelta(lockerID, start, stop); - } - mozilla::Telemetry::AccumulateTimeDelta(generalID, start, stop); } void diff --git a/netwerk/cache/nsDiskCacheMap.cpp b/netwerk/cache/nsDiskCacheMap.cpp index d7ce13a35a..d3ec1e714b 100644 --- a/netwerk/cache/nsDiskCacheMap.cpp +++ b/netwerk/cache/nsDiskCacheMap.cpp @@ -19,7 +19,6 @@ #include "mozilla/MemoryReporting.h" #include "mozilla/Sprintf.h" -#include "mozilla/Telemetry.h" #include <algorithm> using namespace mozilla; @@ -181,9 +180,6 @@ nsDiskCacheMap::Open(nsIFile * cacheDirectory, goto error_exit; } - Telemetry::Accumulate(Telemetry::HTTP_DISK_CACHE_OVERHEAD, - (uint32_t)SizeOfExcludingThis(moz_malloc_size_of)); - *corruptInfo = nsDiskCache::kNotCorrupt; return NS_OK; diff --git a/netwerk/cache2/CacheFile.cpp b/netwerk/cache2/CacheFile.cpp index fa0a893823..ce771c754c 100644 --- a/netwerk/cache2/CacheFile.cpp +++ b/netwerk/cache2/CacheFile.cpp @@ -14,7 +14,6 @@ #include <algorithm> #include "nsComponentManagerUtils.h" #include "nsProxyRelease.h" -#include "mozilla/Telemetry.h" // When CACHE_CHUNKS is defined we always cache unused chunks in mCacheChunks. // When it is not defined, we always release the chunks ASAP, i.e. we cache @@ -1914,9 +1913,6 @@ CacheFile::RemoveInput(CacheFileInputStream *aInput, nsresult aStatus) // chunks that won't be used anymore. CleanUpCachedChunks(); - Telemetry::Accumulate(Telemetry::NETWORK_CACHE_V2_INPUT_STREAM_STATUS, - StatusToTelemetryEnum(aStatus)); - return NS_OK; } @@ -1952,9 +1948,6 @@ CacheFile::RemoveOutput(CacheFileOutputStream *aOutput, nsresult aStatus) // Notify close listener as the last action aOutput->NotifyCloseListener(); - Telemetry::Accumulate(Telemetry::NETWORK_CACHE_V2_OUTPUT_STREAM_STATUS, - StatusToTelemetryEnum(aStatus)); - return NS_OK; } diff --git a/netwerk/cache2/CacheFileIOManager.cpp b/netwerk/cache2/CacheFileIOManager.cpp index 1d0d576355..98fdc24ac6 100644 --- a/netwerk/cache2/CacheFileIOManager.cpp +++ b/netwerk/cache2/CacheFileIOManager.cpp @@ -21,7 +21,6 @@ #include "nsIObserverService.h" #include "nsICacheStorageVisitor.h" #include "nsISizeOf.h" -#include "mozilla/Telemetry.h" #include "mozilla/DebugOnly.h" #include "mozilla/Services.h" #include "nsDirectoryServiceUtils.h" @@ -3861,7 +3860,6 @@ CacheFileIOManager::CreateCacheTree() } #endif - Telemetry::Accumulate(Telemetry::NETWORK_CACHE_FS_TYPE, fsType); CacheObserver::SetCacheFSReported(); } @@ -3917,8 +3915,6 @@ CacheFileIOManager::OpenNSPRHandle(CacheFileHandle *aHandle, bool aCreate) uint32_t cacheUsage; if (NS_SUCCEEDED(CacheIndex::GetCacheSize(&cacheUsage))) { cacheUsage >>= 10; - Telemetry::Accumulate(Telemetry::NETWORK_CACHE_SIZE_FULL_FAT, - cacheUsage); sSizeReported = true; } } diff --git a/netwerk/cache2/CacheFileMetadata.cpp b/netwerk/cache2/CacheFileMetadata.cpp index 3814b4c878..86fc089aaf 100644 --- a/netwerk/cache2/CacheFileMetadata.cpp +++ b/netwerk/cache2/CacheFileMetadata.cpp @@ -14,7 +14,6 @@ #include "nsICacheEntry.h" // for nsICacheEntryMetaDataVisitor #include "../cache/nsCacheUtils.h" #include "nsIFile.h" -#include "mozilla/Telemetry.h" #include "mozilla/DebugOnly.h" #include "prnetdb.h" @@ -687,16 +686,6 @@ CacheFileMetadata::OnDataRead(CacheFileHandle *aHandle, char *aBuf, return NS_OK; } - if (mFirstRead) { - Telemetry::AccumulateTimeDelta( - Telemetry::NETWORK_CACHE_METADATA_FIRST_READ_TIME_MS, mReadStart); - Telemetry::Accumulate( - Telemetry::NETWORK_CACHE_METADATA_FIRST_READ_SIZE, mBufSize); - } else { - Telemetry::AccumulateTimeDelta( - Telemetry::NETWORK_CACHE_METADATA_SECOND_READ_TIME_MS, mReadStart); - } - // check whether we have read all necessary data uint32_t realOffset = NetworkEndian::readUint32(mBuf + mBufSize - sizeof(uint32_t)); @@ -776,9 +765,6 @@ CacheFileMetadata::OnDataRead(CacheFileHandle *aHandle, char *aBuf, return NS_OK; } - Telemetry::Accumulate(Telemetry::NETWORK_CACHE_METADATA_SIZE, - size - realOffset); - // We have all data according to offset information at the end of the entry. // Try to parse it. rv = ParseMetadata(realOffset, realOffset - usedOffset, true); diff --git a/netwerk/cache2/CacheFileUtils.cpp b/netwerk/cache2/CacheFileUtils.cpp index d43e958bff..fe1a53b3d4 100644 --- a/netwerk/cache2/CacheFileUtils.cpp +++ b/netwerk/cache2/CacheFileUtils.cpp @@ -7,7 +7,6 @@ #include "CacheFileUtils.h" #include "LoadContextInfo.h" #include "mozilla/Tokenizer.h" -#include "mozilla/Telemetry.h" #include "nsCOMPtr.h" #include "nsAutoPtr.h" #include "nsString.h" @@ -474,19 +473,6 @@ DetailedCacheHitTelemetry::AddRecord(ERecType aType, TimeStamp aLoadStart) StaticMutexAutoLock lock(sLock); - if (aType == MISS) { - mozilla::Telemetry::AccumulateTimeDelta( - mozilla::Telemetry::NETWORK_CACHE_V2_MISS_TIME_MS, - aLoadStart); - } else { - mozilla::Telemetry::AccumulateTimeDelta( - mozilla::Telemetry::NETWORK_CACHE_V2_HIT_TIME_MS, - aLoadStart); - } - - Telemetry::Accumulate(Telemetry::NETWORK_CACHE_HIT_MISS_STAT_PER_CACHE_SIZE, - hitMissValue); - sHRStats[rangeIdx].AddRecord(aType); ++sRecordCnt; @@ -505,8 +491,6 @@ DetailedCacheHitTelemetry::AddRecord(ERecType aType, TimeStamp aLoadStart) uint32_t bucketOffset = sHRStats[i].GetHitRateBucket(kHitRateBuckets) * kNumOfRanges; - Telemetry::Accumulate(Telemetry::NETWORK_CACHE_HIT_RATE_PER_CACHE_SIZE, - bucketOffset + i); sHRStats[i].Reset(); } } diff --git a/netwerk/cache2/CacheFileUtils.h b/netwerk/cache2/CacheFileUtils.h index 3371c3eb56..13acfd71dc 100644 --- a/netwerk/cache2/CacheFileUtils.h +++ b/netwerk/cache2/CacheFileUtils.h @@ -138,7 +138,7 @@ private: // 10-%15%, ... static const uint32_t kHitRateBuckets = 20; - // Protects sRecordCnt, sHitStats and Telemetry::Accumulated() calls. + // Protects sRecordCnt and sHitStats calls. static StaticMutex sLock; // Counter of samples that is compared against kTotalSamplesReportLimit. diff --git a/netwerk/cache2/CacheIOThread.cpp b/netwerk/cache2/CacheIOThread.cpp index b96f03216c..d51f61b0f5 100644 --- a/netwerk/cache2/CacheIOThread.cpp +++ b/netwerk/cache2/CacheIOThread.cpp @@ -62,8 +62,6 @@ void CacheIOTelemetry::Report(uint32_t aLevel, CacheIOTelemetry::size_type aLeng // 10 is number of buckets we have in each probe aLength = std::min<size_type>(aLength, 10); - - Telemetry::Accumulate(telemetryID[aLevel], aLength - 1); // counted from 0 } } // anon diff --git a/netwerk/cache2/CacheIndex.cpp b/netwerk/cache2/CacheIndex.cpp index 4525bbe6d6..1009aeaf8a 100644 --- a/netwerk/cache2/CacheIndex.cpp +++ b/netwerk/cache2/CacheIndex.cpp @@ -3757,7 +3757,6 @@ ReportHashSizeMatch(const SHA1Sum::Hash *aHash1, const SHA1Sum::Hash *aHash2) bitsDiff++; uint8_t hashSizeMatch = debruijn32[bitsDiff*0x076be629>>27] + (i<<5); - Telemetry::Accumulate(Telemetry::NETWORK_CACHE_HASH_STATS, hashSizeMatch); return; } diff --git a/netwerk/cache2/CacheStorageService.cpp b/netwerk/cache2/CacheStorageService.cpp index 67ef4c5267..85f364e4e4 100644 --- a/netwerk/cache2/CacheStorageService.cpp +++ b/netwerk/cache2/CacheStorageService.cpp @@ -2084,8 +2084,6 @@ CacheStorageService::TelemetryRecordEntryCreation(CacheEntry const* entry) mPurgeTimeStamps.Remove(key); - Telemetry::AccumulateTimeDelta(Telemetry::HTTP_CACHE_ENTRY_RELOAD_TIME, - timeStamp, TimeStamp::NowLoRes()); } void @@ -2112,9 +2110,6 @@ CacheStorageService::TelemetryRecordEntryRemoval(CacheEntry const* entry) TelemetryPrune(now); mPurgeTimeStamps.Put(key, now); - Telemetry::Accumulate(Telemetry::HTTP_CACHE_ENTRY_REUSE_COUNT, entry->UseCount()); - Telemetry::AccumulateTimeDelta(Telemetry::HTTP_CACHE_ENTRY_ALIVE_TIME, - entry->LoadStart(), TimeStamp::NowLoRes()); } // nsIMemoryReporter diff --git a/netwerk/cache2/OldWrappers.cpp b/netwerk/cache2/OldWrappers.cpp index 81df88df0e..76a4fa6c19 100644 --- a/netwerk/cache2/OldWrappers.cpp +++ b/netwerk/cache2/OldWrappers.cpp @@ -21,7 +21,6 @@ #include "nsNetCID.h" #include "nsNetUtil.h" #include "nsProxyRelease.h" -#include "mozilla/Telemetry.h" static NS_DEFINE_CID(kStreamTransportServiceCID, NS_STREAMTRANSPORTSERVICE_CID); @@ -793,24 +792,6 @@ _OldCacheLoad::Run() return NS_OK; } - if (NS_SUCCEEDED(mStatus)) { - if (mFlags & nsICacheStorage::OPEN_TRUNCATE) { - mozilla::Telemetry::AccumulateTimeDelta( - mozilla::Telemetry::NETWORK_CACHE_V1_TRUNCATE_TIME_MS, - mLoadStart); - } - else if (mNew) { - mozilla::Telemetry::AccumulateTimeDelta( - mozilla::Telemetry::NETWORK_CACHE_V1_MISS_TIME_MS, - mLoadStart); - } - else { - mozilla::Telemetry::AccumulateTimeDelta( - mozilla::Telemetry::NETWORK_CACHE_V1_HIT_TIME_MS, - mLoadStart); - } - } - if (!(mFlags & CHECK_MULTITHREADED)) Check(); diff --git a/netwerk/cookie/nsCookieService.cpp b/netwerk/cookie/nsCookieService.cpp index 1c4e5e7409..52558107b5 100644 --- a/netwerk/cookie/nsCookieService.cpp +++ b/netwerk/cookie/nsCookieService.cpp @@ -3325,11 +3325,6 @@ nsCookieService::SetCookieInternal(nsIURI *aHostURI, // 3 = secure and "https:" bool isHTTPS; nsresult rv = aHostURI->SchemeIs("https", &isHTTPS); - if (NS_SUCCEEDED(rv)) { - Telemetry::Accumulate(Telemetry::COOKIE_SCHEME_SECURITY, - ((cookieAttributes.isSecure)? 0x02 : 0x00) | - ((isHTTPS)? 0x01 : 0x00)); - } int64_t currentTimeInUsec = PR_Now(); @@ -3480,8 +3475,6 @@ nsCookieService::AddInternal(const nsCookieKey &aKey, if (mLeaveSecureAlone && aCookie->IsSecure() && !isSecure) { COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader, "non-https cookie can't set secure flag"); - Telemetry::Accumulate(Telemetry::COOKIE_LEAVE_SECURE_ALONE, - BLOCKED_SECURE_SET_FROM_HTTP); return; } nsListIter exactIter; @@ -3502,14 +3495,7 @@ nsCookieService::AddInternal(const nsCookieKey &aKey, if (!isSecure) { COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader, "cookie can't save because older cookie is secure cookie but newer cookie is non-secure cookie"); - Telemetry::Accumulate(Telemetry::COOKIE_LEAVE_SECURE_ALONE, - BLOCKED_DOWNGRADE_SECURE); return; - } else { - // A secure site is allowed to downgrade a secure cookie - // but we want to measure anyway - Telemetry::Accumulate(Telemetry::COOKIE_LEAVE_SECURE_ALONE, - DOWNGRADE_SECURE_FROM_SECURE); } } } @@ -3609,8 +3595,6 @@ nsCookieService::AddInternal(const nsCookieKey &aKey, // It's valid to evict a secure cookie for another secure cookie. oldestCookieTime = FindStaleCookie(entry, currentTime, aHostURI, Some(true), iter); } else { - Telemetry::Accumulate(Telemetry::COOKIE_LEAVE_SECURE_ALONE, - EVICTING_SECURE_BLOCKED); COOKIE_LOGEVICTED(aCookie, "Too many cookies for this domain and the new cookie is not a secure cookie"); return; @@ -4651,19 +4635,7 @@ void nsCookieService::TelemetryForEvictingStaleCookie(nsCookie *aEvicted, int64_t oldestCookieTime) { - // We need to record the evicting cookie to telemetry. - if (!aEvicted->IsSecure()) { - if (aEvicted->LastAccessed() > oldestCookieTime) { - Telemetry::Accumulate(Telemetry::COOKIE_LEAVE_SECURE_ALONE, - EVICTED_NEWER_INSECURE); - } else { - Telemetry::Accumulate(Telemetry::COOKIE_LEAVE_SECURE_ALONE, - EVICTED_OLDEST_COOKIE); - } - } else { - Telemetry::Accumulate(Telemetry::COOKIE_LEAVE_SECURE_ALONE, - EVICTED_PREFERRED_COOKIE); - } + /* STUB */ } // count the number of cookies stored by a particular host. this is provided by the diff --git a/netwerk/dns/nsHostResolver.cpp b/netwerk/dns/nsHostResolver.cpp index f2e26cadd4..c4883ab299 100644 --- a/netwerk/dns/nsHostResolver.cpp +++ b/netwerk/dns/nsHostResolver.cpp @@ -225,7 +225,6 @@ nsHostRecord::CopyExpirationTimesAndFlagsFrom(const nsHostRecord *aFromHostRecor nsHostRecord::~nsHostRecord() { - Telemetry::Accumulate(Telemetry::DNS_BLACKLIST_COUNT, mBlacklistedCount); delete addr_info; delete addr; } @@ -775,7 +774,6 @@ nsHostResolver::ResolveHost(const char *host, LOG_HOST(host, netInterface))); // put reference to host record on stack... result = he->rec; - Telemetry::Accumulate(Telemetry::DNS_LOOKUP_METHOD2, METHOD_HIT); // For entries that are in the grace period // or all cached negative entries, use the cache but start a new @@ -785,8 +783,6 @@ nsHostResolver::ResolveHost(const char *host, if (he->rec->negative) { LOG((" Negative cache entry for host [%s%s%s].\n", LOG_HOST(host, netInterface))); - Telemetry::Accumulate(Telemetry::DNS_LOOKUP_METHOD2, - METHOD_NEGATIVE_HIT); status = NS_ERROR_UNKNOWN_HOST; } } @@ -794,8 +790,6 @@ nsHostResolver::ResolveHost(const char *host, // go ahead and use it. else if (he->rec->addr) { LOG((" Using cached address for IP Literal [%s].\n", host)); - Telemetry::Accumulate(Telemetry::DNS_LOOKUP_METHOD2, - METHOD_LITERAL); result = he->rec; } // try parsing the host name as an IP address literal to short @@ -808,8 +802,6 @@ nsHostResolver::ResolveHost(const char *host, he->rec->addr = new NetAddr(); PRNetAddrToNetAddr(&tempAddr, he->rec->addr); // put reference to host record on stack... - Telemetry::Accumulate(Telemetry::DNS_LOOKUP_METHOD2, - METHOD_LITERAL); result = he->rec; } else if (mPendingCount >= MAX_NON_PRIORITY_REQUESTS && @@ -819,8 +811,6 @@ nsHostResolver::ResolveHost(const char *host, "host [%s%s%s].\n", IsMediumPriority(flags) ? "medium" : "low", LOG_HOST(host, netInterface))); - Telemetry::Accumulate(Telemetry::DNS_LOOKUP_METHOD2, - METHOD_OVERFLOW); // This is a lower priority request and we are swamped, so refuse it. rv = NS_ERROR_DNS_LOOKUP_QUEUE_FULL; } @@ -885,8 +875,6 @@ nsHostResolver::ResolveHost(const char *host, if (he->rec->negative) { status = NS_ERROR_UNKNOWN_HOST; } - Telemetry::Accumulate(Telemetry::DNS_LOOKUP_METHOD2, - METHOD_HIT); ConditionallyRefreshRecord(he->rec, host); } // For AF_INET6, a new lookup means another AF_UNSPEC @@ -900,8 +888,6 @@ nsHostResolver::ResolveHost(const char *host, result = he->rec; he->rec->negative = true; status = NS_ERROR_UNKNOWN_HOST; - Telemetry::Accumulate(Telemetry::DNS_LOOKUP_METHOD2, - METHOD_NEGATIVE_HIT); } } } @@ -915,8 +901,6 @@ nsHostResolver::ResolveHost(const char *host, PR_APPEND_LINK(callback, &he->rec->callbacks); he->rec->flags = flags; rv = IssueLookup(he->rec); - Telemetry::Accumulate(Telemetry::DNS_LOOKUP_METHOD2, - METHOD_NETWORK_FIRST); if (NS_FAILED(rv)) { PR_REMOVE_AND_INIT_LINK(callback); } @@ -933,8 +917,6 @@ nsHostResolver::ResolveHost(const char *host, PR_APPEND_LINK(callback, &he->rec->callbacks); if (he->rec->onQueue) { - Telemetry::Accumulate(Telemetry::DNS_LOOKUP_METHOD2, - METHOD_NETWORK_SHARED); // Consider the case where we are on a pending queue of // lower priority than the request is being made at. @@ -1085,13 +1067,6 @@ nsHostResolver::ConditionallyRefreshRecord(nsHostRecord *rec, const char *host) LOG((" Using %s cache entry for host [%s] but starting async renewal.", rec->negative ? "negative" :"positive", host)); IssueLookup(rec); - - if (!rec->negative) { - // negative entries are constantly being refreshed, only - // track positive grace period induced renewals - Telemetry::Accumulate(Telemetry::DNS_LOOKUP_METHOD2, - METHOD_RENEWAL); - } } return NS_OK; } @@ -1326,13 +1301,6 @@ nsHostResolver::OnLookupComplete(nsHostRecord* rec, nsresult status, AddrInfo* n PR_REMOVE_AND_INIT_LINK(head); mDB.Remove((nsHostKey *) head); - if (!head->negative) { - // record the age of the entry upon eviction. - TimeDuration age = TimeStamp::NowLoRes() - head->mValidStart; - Telemetry::Accumulate(Telemetry::DNS_CLEANUP_AGE, - static_cast<uint32_t>(age.ToSeconds() / 60)); - } - // release reference to rec owned by mEvictionQ NS_RELEASE(head); } @@ -1467,32 +1435,6 @@ nsHostResolver::ThreadFunc(void *arg) } #endif - { // obtain lock to check shutdown and manage inter-module telemetry - MutexAutoLock lock(resolver->mLock); - - if (!resolver->mShutdown) { - TimeDuration elapsed = TimeStamp::Now() - startTime; - uint32_t millis = static_cast<uint32_t>(elapsed.ToMilliseconds()); - - if (NS_SUCCEEDED(status)) { - Telemetry::ID histogramID; - if (!rec->addr_info_gencnt) { - // Time for initial lookup. - histogramID = Telemetry::DNS_LOOKUP_TIME; - } else if (!getTtl) { - // Time for renewal; categorized by expiration strategy. - histogramID = Telemetry::DNS_RENEWAL_TIME; - } else { - // Time to get TTL; categorized by expiration strategy. - histogramID = Telemetry::DNS_RENEWAL_TIME_FOR_TTL; - } - Telemetry::Accumulate(histogramID, millis); - } else { - Telemetry::Accumulate(Telemetry::DNS_FAILED_LOOKUP_TIME, millis); - } - } - } - // OnLookupComplete may release "rec", long before we lose it. LOG(("DNS lookup thread - lookup completed for host [%s%s%s]: %s.\n", LOG_HOST(rec->host, rec->netInterface), diff --git a/netwerk/protocol/http/ASpdySession.cpp b/netwerk/protocol/http/ASpdySession.cpp index f22c326d1a..d5d98804d0 100644 --- a/netwerk/protocol/http/ASpdySession.cpp +++ b/netwerk/protocol/http/ASpdySession.cpp @@ -45,8 +45,6 @@ ASpdySession::NewSpdySession(uint32_t version, // from a list provided in the SERVER HELLO filtered by our acceptable // versions, so there is no risk of the server ignoring our prefs. - Telemetry::Accumulate(Telemetry::SPDY_VERSION2, version); - return new Http2Session(aTransport, version, attemptingEarlyData); } diff --git a/netwerk/protocol/http/Http2Compression.cpp b/netwerk/protocol/http/Http2Compression.cpp index 1b4603e1af..64fd05a170 100644 --- a/netwerk/protocol/http/Http2Compression.cpp +++ b/netwerk/protocol/http/Http2Compression.cpp @@ -292,12 +292,6 @@ Http2BaseCompressor::Http2BaseCompressor() Http2BaseCompressor::~Http2BaseCompressor() { - if (mPeakSize) { - Telemetry::Accumulate(mPeakSizeID, mPeakSize); - } - if (mPeakCount) { - Telemetry::Accumulate(mPeakCountID, mPeakCount); - } UnregisterStrongMemoryReporter(mDynamicReporter); mDynamicReporter->mCompressor = nullptr; mDynamicReporter = nullptr; @@ -336,16 +330,6 @@ Http2BaseCompressor::MakeRoom(uint32_t amount, const char *direction) bytesEvicted += mHeaderTable[index]->Size(); mHeaderTable.RemoveElement(); } - - if (!strcmp(direction, "decompressor")) { - Telemetry::Accumulate(Telemetry::HPACK_ELEMENTS_EVICTED_DECOMPRESSOR, countEvicted); - Telemetry::Accumulate(Telemetry::HPACK_BYTES_EVICTED_DECOMPRESSOR, bytesEvicted); - Telemetry::Accumulate(Telemetry::HPACK_BYTES_EVICTED_RATIO_DECOMPRESSOR, (uint32_t)((100.0 * (double)bytesEvicted) / (double)amount)); - } else { - Telemetry::Accumulate(Telemetry::HPACK_ELEMENTS_EVICTED_COMPRESSOR, countEvicted); - Telemetry::Accumulate(Telemetry::HPACK_BYTES_EVICTED_COMPRESSOR, bytesEvicted); - Telemetry::Accumulate(Telemetry::HPACK_BYTES_EVICTED_RATIO_COMPRESSOR, (uint32_t)((100.0 * (double)bytesEvicted) / (double)amount)); - } } void diff --git a/netwerk/protocol/http/Http2Session.cpp b/netwerk/protocol/http/Http2Session.cpp index 4f350af83b..4a178f0910 100644 --- a/netwerk/protocol/http/Http2Session.cpp +++ b/netwerk/protocol/http/Http2Session.cpp @@ -168,13 +168,6 @@ Http2Session::~Http2Session() this, mDownstreamState)); Shutdown(); - - Telemetry::Accumulate(Telemetry::SPDY_PARALLEL_STREAMS, mConcurrentHighWater); - Telemetry::Accumulate(Telemetry::SPDY_REQUEST_PER_CONN, (mNextStreamID - 1) / 2); - Telemetry::Accumulate(Telemetry::SPDY_SERVER_INITIATED_STREAMS, - mServerPushedResources); - Telemetry::Accumulate(Telemetry::SPDY_GOAWAY_LOCAL, mClientGoAwayReason); - Telemetry::Accumulate(Telemetry::SPDY_GOAWAY_PEER, mPeerGoAwayReason); } void @@ -1508,13 +1501,11 @@ Http2Session::RecvSettings(Http2Session *self) case SETTINGS_TYPE_MAX_CONCURRENT: self->mMaxConcurrent = value; - Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_MAX_STREAMS, value); self->ProcessPending(); break; case SETTINGS_TYPE_INITIAL_WINDOW: { - Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_IW, value >> 10); int32_t delta = value - self->mServerInitialStreamWindow; self->mServerInitialStreamWindow = value; @@ -2494,8 +2485,6 @@ Http2Session::ReadyToProcessDataFrame(enum internalStateType newState) newState == DISCARDING_DATA_FRAME_PADDING); ChangeDownstreamState(newState); - Telemetry::Accumulate(Telemetry::SPDY_CHUNK_RECVD, - mInputFrameDataSize >> 10); mLastDataReadEpoch = mLastReadEpoch; if (!mInputFrameID) { diff --git a/netwerk/protocol/http/Http2Stream.cpp b/netwerk/protocol/http/Http2Stream.cpp index 7a8f968550..3471985dd4 100644 --- a/netwerk/protocol/http/Http2Stream.cpp +++ b/netwerk/protocol/http/Http2Stream.cpp @@ -21,7 +21,6 @@ #include "Http2Push.h" #include "TunnelUtils.h" -#include "mozilla/Telemetry.h" #include "nsAlgorithm.h" #include "nsHttp.h" #include "nsHttpHandler.h" @@ -658,8 +657,6 @@ Http2Stream::GenerateOpen() outputOffset += frameLen; } - Telemetry::Accumulate(Telemetry::SPDY_SYN_SIZE, compressedData.Length()); - // The size of the input headers is approximate uint32_t ratio = compressedData.Length() * 100 / @@ -667,7 +664,6 @@ Http2Stream::GenerateOpen() mFlatHttpRequestHeaders.Length()); mFlatHttpRequestHeaders.Truncate(); - Telemetry::Accumulate(Telemetry::SPDY_SYN_RATIO, ratio); return NS_OK; } @@ -1025,13 +1021,6 @@ Http2Stream::ConvertResponseHeaders(Http2Decompressor *decompressor, return NS_ERROR_ILLEGAL_VALUE; } - if (aHeadersIn.Length() && aHeadersOut.Length()) { - Telemetry::Accumulate(Telemetry::SPDY_SYN_REPLY_SIZE, aHeadersIn.Length()); - uint32_t ratio = - aHeadersIn.Length() * 100 / aHeadersOut.Length(); - Telemetry::Accumulate(Telemetry::SPDY_SYN_REPLY_RATIO, ratio); - } - // The decoding went ok. Now we can customize and clean up. aHeadersIn.Truncate(); diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index d161f9a432..c4e764d26d 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -49,7 +49,6 @@ #include "LoadInfo.h" #include "nsNullPrincipal.h" #include "nsISSLSocketControl.h" -#include "mozilla/Telemetry.h" #include "nsIURL.h" #include "nsIConsoleService.h" #include "mozilla/BinarySearch.h" @@ -1006,7 +1005,6 @@ HttpBaseChannel::DoApplyContentConversions(nsIStreamListener* aNextListener, } else if (from.Equals("br")) { mode = 3; } - Telemetry::Accumulate(Telemetry::HTTP_CONTENT_ENCODING, mode); } nextListener = converter; } diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index d7247eeab8..bb0b3ca774 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -133,18 +133,7 @@ enum CacheDisposition { void AccumulateCacheHitTelemetry(CacheDisposition hitOrMiss) { - if (!CacheObserver::UseNewCache()) { - Telemetry::Accumulate(Telemetry::HTTP_CACHE_DISPOSITION_2, hitOrMiss); - } - else { - Telemetry::Accumulate(Telemetry::HTTP_CACHE_DISPOSITION_2_V2, hitOrMiss); - - int32_t experiment = CacheObserver::HalfLifeExperiment(); - if (experiment > 0 && hitOrMiss == kCacheMissed) { - Telemetry::Accumulate(Telemetry::HTTP_CACHE_MISS_HALFLIFE_EXPERIMENT_2, - experiment - 1); - } - } + /* STUB */ } // Computes and returns a SHA1 hash of the input buffer. The input buffer @@ -1141,26 +1130,21 @@ EnsureMIMEOfScript(nsIURI* aURI, nsHttpResponseHead* aResponseHead, nsILoadInfo* if (nsContentUtils::IsJavascriptMIMEType(typeString)) { // script load has type script - Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 1); return NS_OK; } bool block = false; if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("image/"))) { // script load has type image - Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 2); block = true; } else if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("audio/"))) { // script load has type audio - Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 3); block = true; } else if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("video/"))) { // script load has type video - Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 4); block = true; } else if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("text/csv"))) { // script load has type text/csv - Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 6); block = true; } @@ -1186,42 +1170,35 @@ EnsureMIMEOfScript(nsIURI* aURI, nsHttpResponseHead* aResponseHead, nsILoadInfo* if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("text/plain"))) { // script load has type text/plain - Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 5); return NS_OK; } if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("text/xml"))) { // script load has type text/xml - Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 7); return NS_OK; } if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("application/octet-stream"))) { // script load has type application/octet-stream - Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 8); return NS_OK; } if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("application/xml"))) { // script load has type application/xml - Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 9); return NS_OK; } if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("text/html"))) { // script load has type text/html - Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 10); return NS_OK; } if (contentType.IsEmpty()) { // script load has no type - Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 11); return NS_OK; } // script load has unknown type - Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 0); return NS_OK; } @@ -1867,65 +1844,6 @@ nsHttpChannel::ProcessResponse() LOG(("nsHttpChannel::ProcessResponse [this=%p httpStatus=%u]\n", this, httpStatus)); - // do some telemetry - if (gHttpHandler->IsTelemetryEnabled()) { - // Gather data on whether the transaction and page (if this is - // the initial page load) is being loaded with SSL. - Telemetry::Accumulate(Telemetry::HTTP_TRANSACTION_IS_SSL, - mConnectionInfo->EndToEndSSL()); - if (mLoadFlags & LOAD_INITIAL_DOCUMENT_URI) { - Telemetry::Accumulate(Telemetry::HTTP_PAGELOAD_IS_SSL, - mConnectionInfo->EndToEndSSL()); - } - - // how often do we see something like Alternate-Protocol: "443:quic,p=1" - nsAutoCString alt_protocol; - mResponseHead->GetHeader(nsHttp::Alternate_Protocol, alt_protocol); - bool saw_quic = (!alt_protocol.IsEmpty() && - PL_strstr(alt_protocol.get(), "quic")) ? 1 : 0; - Telemetry::Accumulate(Telemetry::HTTP_SAW_QUIC_ALT_PROTOCOL, saw_quic); - - // Gather data on how many URLS get redirected - switch (httpStatus) { - case 200: - Telemetry::Accumulate(Telemetry::HTTP_RESPONSE_STATUS_CODE, 0); - break; - case 301: - Telemetry::Accumulate(Telemetry::HTTP_RESPONSE_STATUS_CODE, 1); - break; - case 302: - Telemetry::Accumulate(Telemetry::HTTP_RESPONSE_STATUS_CODE, 2); - break; - case 304: - Telemetry::Accumulate(Telemetry::HTTP_RESPONSE_STATUS_CODE, 3); - break; - case 307: - Telemetry::Accumulate(Telemetry::HTTP_RESPONSE_STATUS_CODE, 4); - break; - case 308: - Telemetry::Accumulate(Telemetry::HTTP_RESPONSE_STATUS_CODE, 5); - break; - case 400: - Telemetry::Accumulate(Telemetry::HTTP_RESPONSE_STATUS_CODE, 6); - break; - case 401: - Telemetry::Accumulate(Telemetry::HTTP_RESPONSE_STATUS_CODE, 7); - break; - case 403: - Telemetry::Accumulate(Telemetry::HTTP_RESPONSE_STATUS_CODE, 8); - break; - case 404: - Telemetry::Accumulate(Telemetry::HTTP_RESPONSE_STATUS_CODE, 9); - break; - case 500: - Telemetry::Accumulate(Telemetry::HTTP_RESPONSE_STATUS_CODE, 10); - break; - default: - Telemetry::Accumulate(Telemetry::HTTP_RESPONSE_STATUS_CODE, 11); - break; - } - } - // Let the predictor know whether this was a cacheable response or not so // that it knows whether or not to possibly prefetch this resource in the // future. @@ -2204,9 +2122,6 @@ nsHttpChannel::ContinueProcessResponse2(nsresult rv) } AccumulateCacheHitTelemetry(cacheDisposition); - Telemetry::Accumulate(Telemetry::HTTP_RESPONSE_VERSION, - mResponseHead->Version()); - if (mResponseHead->Version() == NS_HTTP_VERSION_0_9) { // DefaultPortTopLevel = 0, DefaultPortSubResource = 1, // NonDefaultPortTopLevel = 2, NonDefaultPortSubResource = 3 @@ -2217,7 +2132,6 @@ nsHttpChannel::ContinueProcessResponse2(nsresult rv) if (mConnectionInfo->OriginPort() != mConnectionInfo->DefaultPort()) { v09Info += 2; } - Telemetry::Accumulate(Telemetry::HTTP_09_INFO, v09Info); } } return rv; @@ -3212,7 +3126,6 @@ nsHttpChannel::ProcessNotModified() PipelineFeedbackInfo(mConnectionInfo, nsHttpConnectionMgr::RedCorruptedContent, nullptr, 0); - Telemetry::Accumulate(Telemetry::CACHE_LM_INCONSISTENT, true); } // merge any new headers with the cached response headers @@ -4222,11 +4135,6 @@ nsHttpChannel::OnNormalCacheEntryAvailable(nsICacheEntry *aEntry, if (NS_SUCCEEDED(aEntryStatus)) { mCacheEntry = aEntry; mCacheEntryIsWriteOnly = aNew; - - if (mLoadFlags & LOAD_INITIAL_DOCUMENT_URI) { - Telemetry::Accumulate(Telemetry::HTTP_OFFLINE_CACHE_DOCUMENT_LOAD, - false); - } } return NS_OK; @@ -5897,17 +5805,13 @@ nsHttpChannel::BeginConnect() LOG(("nsHttpChannel %p Using connection info from altsvc mapping", this)); mapping->GetConnectionInfo(getter_AddRefs(mConnectionInfo), proxyInfo, originAttributes); - Telemetry::Accumulate(Telemetry::HTTP_TRANSACTION_USE_ALTSVC, true); - Telemetry::Accumulate(Telemetry::HTTP_TRANSACTION_USE_ALTSVC_OE, !isHttps); } else if (mConnectionInfo) { LOG(("nsHttpChannel %p Using channel supplied connection info", this)); - Telemetry::Accumulate(Telemetry::HTTP_TRANSACTION_USE_ALTSVC, false); } else { LOG(("nsHttpChannel %p Using default connection info", this)); mConnectionInfo = new nsHttpConnectionInfo(host, port, EmptyCString(), mUsername, proxyInfo, originAttributes, isHttps); - Telemetry::Accumulate(Telemetry::HTTP_TRANSACTION_USE_ALTSVC, false); } // Set network interface id only when it's not empty to avoid @@ -6829,7 +6733,6 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult st chanDisposition = static_cast<ChannelDisposition>(chanDisposition + kHttpsCanceled); } LOG((" nsHttpChannel::OnStopRequest ChannelDisposition %d\n", chanDisposition)); - Telemetry::Accumulate(Telemetry::HTTP_CHANNEL_DISPOSITION, chanDisposition); // if needed, check cache entry has all data we expect if (mCacheEntry && mCachePump && @@ -8200,129 +8103,7 @@ nsHttpChannel::SetDoNotTrack() void nsHttpChannel::ReportNetVSCacheTelemetry() { - nsresult rv; - if (!mCacheEntry) { - return; - } - - // We only report telemetry if the entry is persistent (on disk) - bool persistent; - rv = mCacheEntry->GetPersistent(&persistent); - if (NS_FAILED(rv) || !persistent) { - return; - } - - nsXPIDLCString tmpStr; - rv = mCacheEntry->GetMetaDataElement("net-response-time-onstart", - getter_Copies(tmpStr)); - if (NS_FAILED(rv)) { - return; - } - uint64_t onStartNetTime = tmpStr.ToInteger64(&rv); - if (NS_FAILED(rv)) { - return; - } - - tmpStr.Truncate(); - rv = mCacheEntry->GetMetaDataElement("net-response-time-onstop", - getter_Copies(tmpStr)); - if (NS_FAILED(rv)) { - return; - } - uint64_t onStopNetTime = tmpStr.ToInteger64(&rv); - if (NS_FAILED(rv)) { - return; - } - - uint64_t onStartCacheTime = (mOnStartRequestTimestamp - mAsyncOpenTime).ToMilliseconds(); - int64_t onStartDiff = onStartNetTime - onStartCacheTime; - onStartDiff += 500; // We offset the difference by 500 ms to report positive values in telemetry - - uint64_t onStopCacheTime = (mCacheReadEnd - mAsyncOpenTime).ToMilliseconds(); - int64_t onStopDiff = onStopNetTime - onStopCacheTime; - onStopDiff += 500; // We offset the difference by 500 ms - - if (mDidReval) { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_REVALIDATED, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_REVALIDATED, onStopDiff); - } else { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_NOTREVALIDATED, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_NOTREVALIDATED, onStopDiff); - } - - if (mDidReval) { - // We don't report revalidated probes as the data would be skewed. - return; - } - - uint32_t diskStorageSizeK = 0; - rv = mCacheEntry->GetDiskStorageSizeInKB(&diskStorageSizeK); - if (NS_FAILED(rv)) { - return; - } - - nsAutoCString contentType; - if (mResponseHead && mResponseHead->HasContentType()) { - mResponseHead->ContentType(contentType); - } - bool isImage = StringBeginsWith(contentType, NS_LITERAL_CSTRING("image/")); - if (isImage) { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_ISIMG, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_ISIMG, onStopDiff); - } else { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_NOTIMG, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_NOTIMG, onStopDiff); - } - - if (mCacheOpenWithPriority) { - if (mCacheQueueSizeWhenOpen < 5) { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_QSMALL_HIGHPRI, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_QSMALL_HIGHPRI, onStopDiff); - } else if (mCacheQueueSizeWhenOpen < 10) { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_QMED_HIGHPRI, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_QMED_HIGHPRI, onStopDiff); - } else { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_QBIG_HIGHPRI, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_QBIG_HIGHPRI, onStopDiff); - } - } else { // The limits are higher for normal priority cache queues - if (mCacheQueueSizeWhenOpen < 10) { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_QSMALL_NORMALPRI, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_QSMALL_NORMALPRI, onStopDiff); - } else if (mCacheQueueSizeWhenOpen < 50) { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_QMED_NORMALPRI, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_QMED_NORMALPRI, onStopDiff); - } else { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_QBIG_NORMALPRI, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_QBIG_NORMALPRI, onStopDiff); - } - } - - if (diskStorageSizeK < 32) { - if (mCacheOpenWithPriority) { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_SMALL_HIGHPRI, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_SMALL_HIGHPRI, onStopDiff); - } else { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_SMALL_NORMALPRI, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_SMALL_NORMALPRI, onStopDiff); - } - } else if (diskStorageSizeK < 256) { - if (mCacheOpenWithPriority) { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_MED_HIGHPRI, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_MED_HIGHPRI, onStopDiff); - } else { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_MED_NORMALPRI, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_MED_NORMALPRI, onStopDiff); - } - } else { - if (mCacheOpenWithPriority) { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_LARGE_HIGHPRI, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_LARGE_HIGHPRI, onStopDiff); - } else { - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTART_LARGE_NORMALPRI, onStartDiff); - Telemetry::Accumulate(Telemetry::HTTP_NET_VS_CACHE_ONSTOP_LARGE_NORMALPRI, onStopDiff); - } - } + /* STUB */ } } // namespace net diff --git a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp index d04f47ddc8..0e7eb55c3b 100644 --- a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp +++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp @@ -867,24 +867,6 @@ nsHttpChannelAuthProvider::GetCredentialsForChallenge(const char *challenge, else if (authFlags & nsIHttpAuthenticator::IDENTITY_ENCRYPTED) level = nsIAuthPrompt2::LEVEL_PW_ENCRYPTED; - // Collect statistics on how frequently the various types of HTTP - // authentication are used over SSL and non-SSL connections. - if (gHttpHandler->IsTelemetryEnabled()) { - if (NS_LITERAL_CSTRING("basic").LowerCaseEqualsASCII(authType)) { - Telemetry::Accumulate(Telemetry::HTTP_AUTH_TYPE_STATS, - UsingSSL() ? HTTP_AUTH_BASIC_SECURE : HTTP_AUTH_BASIC_INSECURE); - } else if (NS_LITERAL_CSTRING("digest").LowerCaseEqualsASCII(authType)) { - Telemetry::Accumulate(Telemetry::HTTP_AUTH_TYPE_STATS, - UsingSSL() ? HTTP_AUTH_DIGEST_SECURE : HTTP_AUTH_DIGEST_INSECURE); - } else if (NS_LITERAL_CSTRING("ntlm").LowerCaseEqualsASCII(authType)) { - Telemetry::Accumulate(Telemetry::HTTP_AUTH_TYPE_STATS, - UsingSSL() ? HTTP_AUTH_NTLM_SECURE : HTTP_AUTH_NTLM_INSECURE); - } else if (NS_LITERAL_CSTRING("negotiate").LowerCaseEqualsASCII(authType)) { - Telemetry::Accumulate(Telemetry::HTTP_AUTH_TYPE_STATS, - UsingSSL() ? HTTP_AUTH_NEGOTIATE_SECURE : HTTP_AUTH_NEGOTIATE_INSECURE); - } - } - // Depending on the pref setting, the authentication dialog may be // blocked for all sub-resources, blocked for cross-origin // sub-resources, or always allowed for sub-resources. @@ -991,22 +973,6 @@ nsHttpChannelAuthProvider::BlockPrompt() } } - if (gHttpHandler->IsTelemetryEnabled()) { - if (topDoc) { - Telemetry::Accumulate(Telemetry::HTTP_AUTH_DIALOG_STATS, - HTTP_AUTH_DIALOG_TOP_LEVEL_DOC); - } else if (xhr) { - Telemetry::Accumulate(Telemetry::HTTP_AUTH_DIALOG_STATS, - HTTP_AUTH_DIALOG_XHR); - } else if (!mCrossOrigin) { - Telemetry::Accumulate(Telemetry::HTTP_AUTH_DIALOG_STATS, - HTTP_AUTH_DIALOG_SAME_ORIGIN_SUBRESOURCE); - } else { - Telemetry::Accumulate(Telemetry::HTTP_AUTH_DIALOG_STATS, - HTTP_AUTH_DIALOG_CROSS_ORIGIN_SUBRESOURCE); - } - } - switch (sAuthAllowPref) { case SUBRESOURCE_AUTH_DIALOG_DISALLOW_ALL: // Do not open the http-authentication credentials dialog for diff --git a/netwerk/protocol/http/nsHttpConnection.cpp b/netwerk/protocol/http/nsHttpConnection.cpp index c4564cd8bc..8ccba76e2c 100644 --- a/netwerk/protocol/http/nsHttpConnection.cpp +++ b/netwerk/protocol/http/nsHttpConnection.cpp @@ -19,7 +19,6 @@ #include "ASpdySession.h" #include "mozilla/ChaosMode.h" -#include "mozilla/Telemetry.h" #include "nsHttpConnection.h" #include "nsHttpHandler.h" #include "nsHttpPipeline.h" @@ -105,18 +104,12 @@ nsHttpConnection::~nsHttpConnection() if (!mEverUsedSpdy) { LOG(("nsHttpConnection %p performed %d HTTP/1.x transactions\n", this, mHttp1xTransactionCount)); - Telemetry::Accumulate(Telemetry::HTTP_REQUEST_PER_CONN, - mHttp1xTransactionCount); } if (mTotalBytesRead) { uint32_t totalKBRead = static_cast<uint32_t>(mTotalBytesRead >> 10); LOG(("nsHttpConnection %p read %dkb on connection spdy=%d\n", this, totalKBRead, mEverUsedSpdy)); - Telemetry::Accumulate(mEverUsedSpdy ? - Telemetry::SPDY_KBREAD_PER_CONN : - Telemetry::HTTP_KBREAD_PER_CONN, - totalKBRead); } if (mForceSendTimer) { mForceSendTimer->Cancel(); @@ -482,21 +475,6 @@ nsHttpConnection::EnsureNPNComplete(nsresult &aOut0RTTWriteHandshakeValue, int16_t tlsVersion; ssl->GetSSLVersionUsed(&tlsVersion); - // Send the 0RTT telemetry only for tls1.3 - if (tlsVersion > nsISSLSocketControl::TLS_VERSION_1_2) { - Telemetry::Accumulate(Telemetry::TLS_EARLY_DATA_NEGOTIATED, - (!mEarlyDataNegotiated) ? TLS_EARLY_DATA_NOT_AVAILABLE - : ((mWaitingFor0RTTResponse) ? TLS_EARLY_DATA_AVAILABLE_AND_USED - : TLS_EARLY_DATA_AVAILABLE_BUT_NOT_USED)); - if (mWaitingFor0RTTResponse) { - Telemetry::Accumulate(Telemetry::TLS_EARLY_DATA_ACCEPTED, - earlyDataAccepted); - } - if (earlyDataAccepted) { - Telemetry::Accumulate(Telemetry::TLS_EARLY_DATA_BYTES_WRITTEN, - mContentBytesWritten0RTT); - } - } mWaitingFor0RTTResponse = false; if (!earlyDataAccepted) { @@ -518,8 +496,6 @@ nsHttpConnection::EnsureNPNComplete(nsresult &aOut0RTTWriteHandshakeValue, StartSpdy(mSpdySession->SpdyVersion()); } } - - Telemetry::Accumulate(Telemetry::SPDY_NPN_CONNECT, UsingSpdy()); } npnComplete: diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 9271b49af4..731cdff394 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -23,7 +23,6 @@ #include "mozilla/net/DNS.h" #include "nsISocketTransport.h" #include "nsISSLSocketControl.h" -#include "mozilla/Telemetry.h" #include "mozilla/net/DashboardTypes.h" #include "NullHttpTransaction.h" #include "nsIDNSRecord.h" @@ -847,7 +846,6 @@ nsHttpConnectionMgr::GetSpdyPreferredEnt(nsConnectionEntry *aOriginalEntry) "with %s connections. rv=%x isJoined=%d", preferred->mConnInfo->Origin(), aOriginalEntry->mConnInfo->Origin(), rv, isJoined)); - Telemetry::Accumulate(Telemetry::SPDY_NPN_JOIN, false); return nullptr; } @@ -857,7 +855,6 @@ nsHttpConnectionMgr::GetSpdyPreferredEnt(nsConnectionEntry *aOriginalEntry) "so %s will be coalesced with %s", preferred->mConnInfo->Origin(), aOriginalEntry->mConnInfo->Origin(), aOriginalEntry->mConnInfo->Origin(), preferred->mConnInfo->Origin())); - Telemetry::Accumulate(Telemetry::SPDY_NPN_JOIN, true); return preferred; } @@ -1835,16 +1832,7 @@ nsHttpConnectionMgr::BuildPipeline(nsConnectionEntry *ent, void nsHttpConnectionMgr::ReportProxyTelemetry(nsConnectionEntry *ent) { - enum { PROXY_NONE = 1, PROXY_HTTP = 2, PROXY_SOCKS = 3, PROXY_HTTPS = 4 }; - - if (!ent->mConnInfo->UsingProxy()) - Telemetry::Accumulate(Telemetry::HTTP_PROXY_TYPE, PROXY_NONE); - else if (ent->mConnInfo->UsingHttpsProxy()) - Telemetry::Accumulate(Telemetry::HTTP_PROXY_TYPE, PROXY_HTTPS); - else if (ent->mConnInfo->UsingHttpProxy()) - Telemetry::Accumulate(Telemetry::HTTP_PROXY_TYPE, PROXY_HTTP); - else - Telemetry::Accumulate(Telemetry::HTTP_PROXY_TYPE, PROXY_SOCKS); + /* STUB */ } nsresult @@ -3107,8 +3095,6 @@ nsHalfOpenSocket::SetupStreams(nsISocketTransport **transport, rv = socketTransport->SetSecurityCallbacks(this); NS_ENSURE_SUCCESS(rv, rv); - Telemetry::Accumulate(Telemetry::HTTP_CONNECTION_ENTRY_CACHE_HIT_1, - mEnt->mUsedForConnection); mEnt->mUsedForConnection = true; nsCOMPtr<nsIOutputStream> sout; diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index 89f09190d5..6d58a7004e 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -58,7 +58,6 @@ #include "mozilla/net/NeckoChild.h" #include "mozilla/net/NeckoParent.h" #include "mozilla/ipc/URIUtils.h" -#include "mozilla/Telemetry.h" #include "mozilla/Unused.h" #include "mozilla/BasePrincipal.h" @@ -2182,11 +2181,6 @@ nsHttpHandler::Observe(nsISupports *subject, // depend on this value. mSessionStartTime = NowInSeconds(); - if (!mDoNotTrackEnabled) { - Telemetry::Accumulate(Telemetry::DNT_USAGE, 2); - } else { - Telemetry::Accumulate(Telemetry::DNT_USAGE, 1); - } } else if (!strcmp(topic, "profile-change-net-restore")) { // initialize connection manager InitConnectionMgr(); diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp index c6dc8d3280..1bcdbcacca 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.cpp +++ b/netwerk/protocol/websocket/WebSocketChannel.cpp @@ -55,7 +55,6 @@ #include "nsNetUtil.h" #include "nsINode.h" #include "mozilla/StaticMutex.h" -#include "mozilla/Telemetry.h" #include "mozilla/TimeStamp.h" #include "nsSocketTransportService2.h" @@ -2989,7 +2988,6 @@ WebSocketChannel::ReportConnectionTelemetry() (didProxy ? (1 << 0) : 0); LOG(("WebSocketChannel::ReportConnectionTelemetry() %p %d", this, value)); - Telemetry::Accumulate(Telemetry::WEBSOCKETS_HANDSHAKE_TYPE, value); } // nsIDNSListener diff --git a/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp b/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp index 4fc36928ac..b9f912d1d4 100644 --- a/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp +++ b/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp @@ -24,7 +24,6 @@ #include "mozilla/Services.h" #include "mozilla/SHA1.h" #include "mozilla/Sprintf.h" -#include "mozilla/Telemetry.h" /* a shorter name that better explains what it does */ #define EINTR_RETRY(x) MOZ_TEMP_FAILURE_RETRY(x) @@ -176,12 +175,10 @@ void nsNotifyAddrListener::calculateNetworkId(void) LOG(("networkid: id %s\n", output.get())); if (mNetworkId != output) { // new id - Telemetry::Accumulate(Telemetry::NETWORK_ID, 1); mNetworkId = output; } else { // same id - Telemetry::Accumulate(Telemetry::NETWORK_ID, 2); } found = true; break; @@ -195,7 +192,6 @@ void nsNotifyAddrListener::calculateNetworkId(void) } /* if (froute) */ if (!found) { // no id - Telemetry::Accumulate(Telemetry::NETWORK_ID, 0); } } diff --git a/netwerk/system/mac/nsNetworkLinkService.mm b/netwerk/system/mac/nsNetworkLinkService.mm index ac6a015fbe..5b2d7575ac 100644 --- a/netwerk/system/mac/nsNetworkLinkService.mm +++ b/netwerk/system/mac/nsNetworkLinkService.mm @@ -24,7 +24,6 @@ #include "mozilla/Preferences.h" #include "mozilla/SHA1.h" #include "mozilla/Base64.h" -#include "mozilla/Telemetry.h" #include "nsNetworkLinkService.h" #import <Cocoa/Cocoa.h> @@ -274,19 +273,16 @@ void nsNetworkLinkService::calculateNetworkId(void) LOG(("networkid: id %s\n", output.get())); if (mNetworkId != output) { // new id - Telemetry::Accumulate(Telemetry::NETWORK_ID, 1); mNetworkId = output; } else { // same id - Telemetry::Accumulate(Telemetry::NETWORK_ID, 2); } found = true; } } if (!found) { // no id - Telemetry::Accumulate(Telemetry::NETWORK_ID, 0); } } diff --git a/netwerk/system/win32/nsNotifyAddrListener.cpp b/netwerk/system/win32/nsNotifyAddrListener.cpp index 5d1ec3a61f..58f4345ef8 100644 --- a/netwerk/system/win32/nsNotifyAddrListener.cpp +++ b/netwerk/system/win32/nsNotifyAddrListener.cpp @@ -35,7 +35,6 @@ #include "mozilla/Preferences.h" #include "mozilla/SHA1.h" #include "mozilla/Base64.h" -#include "mozilla/Telemetry.h" #include <iptypes.h> #include <iphlpapi.h> @@ -218,12 +217,10 @@ bool nsNotifyAddrListener::findMac(char *gateway) LOG(("networkid: id %s\n", output.get())); if (mNetworkId != output) { // new id - Telemetry::Accumulate(Telemetry::NETWORK_ID, 1); mNetworkId = output; } else { // same id - Telemetry::Accumulate(Telemetry::NETWORK_ID, 2); } found = true; break; @@ -290,7 +287,6 @@ void nsNotifyAddrListener::calculateNetworkId(void) } if (!found) { // no id - Telemetry::Accumulate(Telemetry::NETWORK_ID, 0); } } |