Issue #21 - Remove Telemetry plumbing and fix build.

Note this won't give working applications. Requires FE changes and
additional js module changes (next part).
This commit is contained in:
Moonchild 2021-10-29 11:02:27 +00:00 • committed by roytam1
commit 8d800b1cb0
205 changed files with 45 additions and 40519 deletions

View file

@ -38,7 +38,6 @@
#include "mozilla/Logging.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "mozilla/net/NeckoCommon.h"
#include "mozilla/net/NeckoParent.h"
@ -1079,9 +1078,6 @@ Predictor::CalculateConfidence(uint32_t hitCount, uint32_t hitsPossible,
{
MOZ_ASSERT(NS_IsMainThread());
Telemetry::AutoCounter<Telemetry::PREDICTOR_PREDICTIONS_CALCULATED> predictionsCalculated;
++predictionsCalculated;
if (!hitsPossible) {
return 0;
}
@ -1316,18 +1312,11 @@ Predictor::RunPredictions(nsIURI *referrer, nsINetworkPredictorVerifier *verifie
preconnects.SwapElements(mPreconnects);
preresolves.SwapElements(mPreresolves);
Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PREDICTIONS> totalPredictions;
Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PREFETCHES> totalPrefetches;
Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PRECONNECTS> totalPreconnects;
Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PRERESOLVES> totalPreresolves;
len = prefetches.Length();
for (i = 0; i < len; ++i) {
PREDICTOR_LOG((" doing prefetch"));
nsCOMPtr<nsIURI> uri = prefetches[i];
if (NS_SUCCEEDED(Prefetch(uri, referrer, verifier))) {
++totalPredictions;
++totalPrefetches;
predicted = true;
}
}
@ -1336,8 +1325,6 @@ Predictor::RunPredictions(nsIURI *referrer, nsINetworkPredictorVerifier *verifie
for (i = 0; i < len; ++i) {
PREDICTOR_LOG((" doing preconnect"));
nsCOMPtr<nsIURI> uri = preconnects[i];
++totalPredictions;
++totalPreconnects;
mSpeculativeService->SpeculativeConnect2(uri, nullptr, this);
predicted = true;
if (verifier) {
@ -1350,8 +1337,6 @@ Predictor::RunPredictions(nsIURI *referrer, nsINetworkPredictorVerifier *verifie
nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
for (i = 0; i < len; ++i) {
nsCOMPtr<nsIURI> uri = preresolves[i];
++totalPredictions;
++totalPreresolves;
nsAutoCString hostname;
uri->GetAsciiHost(hostname);
PREDICTOR_LOG((" doing preresolve %s", hostname.get()));
@ -1482,9 +1467,6 @@ Predictor::Learn(nsIURI *targetURI, nsIURI *sourceURI,
return NS_ERROR_INVALID_ARG;
}
Telemetry::AutoCounter<Telemetry::PREDICTOR_LEARN_ATTEMPTS> learnAttempts;
++learnAttempts;
Predictor::Reason argReason;
argReason.mLearn = reason;

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set ts=4 sw=4 sts=4 et cin: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -11,7 +10,6 @@
#include "mozilla/LoadInfo.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "nsNetUtil.h"
#include "nsNetUtilInlines.h"
#include "mozIApplicationClearPrivateDataParams.h"

View file

@ -21,7 +21,6 @@
#include "nsRefPtrHashtable.h"
#include "mozilla/CondVar.h"
#include "mozilla/Mutex.h"
#include "mozilla/Telemetry.h"
class nsCacheRequest;
class nsCacheProfilePrefObserver;
@ -254,7 +253,6 @@ private:
*/
static void Lock();
static void Lock(::mozilla::Telemetry::ID mainThreadLockerID);
static void Unlock();
void LockAcquired();
void LockReleased();

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -7,7 +6,6 @@
#include "nsDeleteDir.h"
#include "nsIFile.h"
#include "nsString.h"
#include "mozilla/Telemetry.h"
#include "nsITimer.h"
#include "nsISimpleEnumerator.h"
#include "nsAutoPtr.h"

View file

@ -45,7 +45,6 @@
#include "nsThreadUtils.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Telemetry.h"
static const char DISK_CACHE_DEVICE_ID[] = { "disk" };
using namespace mozilla;

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cin: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -46,8 +45,6 @@
#include "nsICacheVisitor.h"
#include "nsISeekableStream.h"
#include "mozilla/Telemetry.h"
#include "sqlite3.h"
#include "mozilla/storage.h"
#include "nsVariant.h"

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set ts=4 sw=4 sts=4 cin et: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -1243,8 +1242,7 @@ nsDiskCacheMap::InitCacheClean(nsIFile * cacheDirectory,
rv = cacheCleanFile->AppendNative(
NS_LITERAL_CSTRING("_CACHE_CLEAN_"));
if (NS_SUCCEEDED(rv)) {
// Check if the file already exists, if it does, we will later read the
// value and report it to telemetry.
// Check if the file already exists.
cacheCleanFile->Exists(&cacheCleanFileExists);
}
}
@ -1406,14 +1404,9 @@ nsDiskCacheMap::RevalidateCache()
"cache not in a safe state\n"));
// Normally we would return an error here, but there is a bug where
// the doom list sometimes gets an entry 'stuck' and doens't clear it
// until browser shutdown. So we allow revalidation for the time being
// to get proper telemetry data of how much the cache corruption plan
// would help.
// until browser shutdown. So we allow revalidation for the time being.
}
// If telemetry data shows it is worth it, we'll be flushing headers and
// records before flushing the clean cache file.
// Write out the _CACHE_CLEAN_ file with '1'
rv = WriteCacheClean(true);
if (NS_FAILED(rv)) {

View file

@ -13,7 +13,6 @@
#include "mozilla/FileUtils.h"
#include "nsThreadUtils.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h"
#include <algorithm>

View file

@ -12,7 +12,6 @@
#include "nsCRT.h"
#include "nsReadableUtils.h"
#include "mozilla/MathAlgorithms.h"
#include "mozilla/Telemetry.h"
#include <algorithm>
// The memory cache implements the "LRU-SP" caching algorithm

View file

@ -25,7 +25,6 @@
#include "nsProxyRelease.h"
#include "nsSerializationHelper.h"
#include "nsThreadUtils.h"
#include "mozilla/Telemetry.h"
#include <math.h>
#include <algorithm>
@ -408,12 +407,7 @@ bool CacheEntry::Load(bool aTruncate, bool aPriority)
bool directLoad = aTruncate || !mUseDisk;
if (directLoad) {
// mLoadStart will be used to calculate telemetry of life-time of this entry.
// Low resulution is then enough.
mLoadStart = TimeStamp::NowLoRes();
mPinningKnown = true;
} else {
mLoadStart = TimeStamp::Now();
}
{
@ -451,8 +445,6 @@ NS_IMETHODIMP CacheEntry::OnFileReady(nsresult aResult, bool aIsNew)
LOG(("CacheEntry::OnFileReady [this=%p, rv=0x%08x, new=%d]",
this, aResult, aIsNew));
MOZ_ASSERT(!mLoadStart.IsNull());
// OnFileReady, that is the only code that can transit from LOADING
// to any follow-on state and can only be invoked ones on an entry.
// Until this moment there is no consumer that could manipulate

View file

@ -88,8 +88,6 @@ public:
bool CanRegister() const;
void SetRegistered(bool aRegistered);
TimeStamp const& LoadStart() const { return mLoadStart; }
enum EPurge {
PURGE_DATA_ONLY_DISK_BACKED,
PURGE_WHOLE_ONLY_DISK_BACKED,
@ -376,7 +374,6 @@ private:
nsCOMPtr<nsISupports> mSecurityInfo;
int64_t mPredictedDataSize;
mozilla::TimeStamp mLoadStart;
uint32_t mUseCount;
};

View file

@ -18,8 +18,6 @@
#include "Http2Push.h"
#include "Http2Session.h"
#include "mozilla/Telemetry.h"
namespace mozilla {
namespace net {

View file

@ -105,7 +105,7 @@ public:
// determine if a version of the protocol is enabled for index < kCount
bool ProtocolEnabled(uint32_t index) const;
uint8_t Version[kCount]; // telemetry enum e.g. SPDY_VERSION_31
uint8_t Version[kCount]; // enum e.g. SPDY_VERSION_31
nsCString VersionString[kCount]; // npn string e.g. "spdy/3.1"
// the ALPNCallback function allows the protocol stack to decide whether or

View file

@ -13,7 +13,6 @@
#include "nsDeque.h"
#include "nsString.h"
#include "nsIMemoryReporter.h"
#include "mozilla/Telemetry.h"
namespace mozilla {
namespace net {
@ -85,10 +84,6 @@ protected:
uint32_t mPeakSize;
uint32_t mPeakCount;
MOZ_INIT_OUTSIDE_CTOR
Telemetry::ID mPeakSizeID;
MOZ_INIT_OUTSIDE_CTOR
Telemetry::ID mPeakCountID;
private:
RefPtr<HpackDynamicTableReporter> mDynamicReporter;
@ -101,8 +96,6 @@ class Http2Decompressor final : public Http2BaseCompressor
public:
Http2Decompressor()
{
mPeakSizeID = Telemetry::HPACK_PEAK_SIZE_DECOMPRESSOR;
mPeakCountID = Telemetry::HPACK_PEAK_COUNT_DECOMPRESSOR;
};
virtual ~Http2Decompressor() { } ;
@ -159,8 +152,6 @@ public:
mBufferSizeChangeWaiting(false),
mLowestBufferSizeWaiting(0)
{
mPeakSizeID = Telemetry::HPACK_PEAK_SIZE_COMPRESSOR;
mPeakCountID = Telemetry::HPACK_PEAK_COUNT_COMPRESSOR;
};
virtual ~Http2Compressor() { }

View file

@ -19,7 +19,6 @@
#include "Http2Push.h"
#include "mozilla/EndianUtils.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Preferences.h"
#include "nsHttp.h"
#include "nsHttpHandler.h"
@ -97,7 +96,6 @@ Http2Session::Http2Session(nsISocketTransport *aSocketTransport, uint32_t versio
, mGoAwayID(0)
, mOutgoingGoAwayID(0)
, mConcurrent(0)
, mServerPushedResources(0)
, mServerInitialStreamWindow(kDefaultRwin)
, mLocalSessionWindow(kDefaultRwin)
, mServerSessionWindow(kDefaultRwin)
@ -1628,7 +1626,6 @@ Http2Session::RecvPushPromise(Http2Session *self)
return rv;
Http2Stream *associatedStream = self->mInputFrameDataStream;
++(self->mServerPushedResources);
// Anytime we start using the high bit of stream ID (either client or server)
// begin to migrate to a new session.

View file

@ -441,9 +441,6 @@ private:
// below the current value
uint32_t mConcurrent;
// The number of server initiated promises, tracked for telemetry
uint32_t mServerPushedResources;
// The server rwin for new streams as determined from a SETTINGS frame
uint32_t mServerInitialStreamWindow;

View file

@ -6585,7 +6585,7 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult st
mTransferSize = mTransaction->GetTransferSize();
// If we are using the transaction to serve content, we also save the
// time since async open in the cache entry so we can compare telemetry
// time since async open in the cache entry so we can compare time
// between cache and net response.
if (request == mTransactionPump && mCacheEntry &&
!mAsyncOpenTime.IsNull() && !mOnStartRequestTimestamp.IsNull()) {

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set et cin ts=4 sw=4 sts=4: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set expandtab ts=4 sw=4 sts=4 cin: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -28,7 +27,6 @@
#include "nsServiceManagerUtils.h"
#include "nsILoadContext.h"
#include "nsIURL.h"
#include "mozilla/Telemetry.h"
#include "nsIProxiedChannel.h"
#include "nsIProxyInfo.h"