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.
This commit is contained in:
wolfbeast 2018-09-03 10:11:38 +02:00 • committed by Roy Tam
commit 8c8145e620
186 changed files with 48 additions and 2957 deletions

View file

@ -15,7 +15,6 @@
#include "nsNetCID.h"
#include "nsPrintfCString.h"
#include "nsThreadUtils.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Logging.h"
#include "mozilla/SyncRunnable.h"
#include "mozilla/Base64.h"
@ -498,9 +497,6 @@ Classifier::Check(const nsACString& aSpec,
matchingStatistics |= PrefixMatch::eMatchV2Prefix;
}
}
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_PREFIX_MATCH,
static_cast<uint8_t>(matchingStatistics));
}
return NS_OK;

View file

@ -6,7 +6,6 @@
#include "LookupCache.h"
#include "HashStore.h"
#include "nsISeekableStream.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Logging.h"
#include "nsNetUtil.h"
#include "prprf.h"
@ -451,9 +450,6 @@ nsresult
LookupCacheV2::Build(AddPrefixArray& aAddPrefixes,
AddCompleteArray& aAddCompletes)
{
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_LC_COMPLETIONS,
static_cast<uint32_t>(aAddCompletes.Length()));
mUpdateCompletions.Clear();
mUpdateCompletions.SetCapacity(aAddCompletes.Length());
for (uint32_t i = 0; i < aAddCompletes.Length(); i++) {
@ -462,9 +458,6 @@ LookupCacheV2::Build(AddPrefixArray& aAddPrefixes,
aAddCompletes.Clear();
mUpdateCompletions.Sort();
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_LC_PREFIXES,
static_cast<uint32_t>(aAddPrefixes.Length()));
nsresult rv = ConstructPrefixSet(aAddPrefixes);
NS_ENSURE_SUCCESS(rv, rv);
mPrimed = true;

View file

@ -144,9 +144,6 @@ LookupCacheV4::LoadFromFile(nsIFile* aFile)
}
rv = VerifyChecksum(checksum);
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_VLPS_LOAD_CORRUPT,
rv == NS_ERROR_FILE_CORRUPTED);
return rv;
}
@ -231,8 +228,6 @@ LookupCacheV4::ApplyUpdate(TableUpdateV4* aTableUpdate,
if (!isOldMapEmpty && !isAddMapEmpty) {
if (smallestOldPrefix == smallestAddPrefix) {
LOG(("Add prefix should not exist in the original prefix set."));
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE,
DUPLICATE_PREFIX);
return NS_ERROR_FAILURE;
}
@ -274,15 +269,11 @@ LookupCacheV4::ApplyUpdate(TableUpdateV4* aTableUpdate,
// the number of original prefix plus add prefix.
if (index <= 0) {
LOG(("There are still prefixes remaining after reaching maximum runs."));
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE,
INFINITE_LOOP);
return NS_ERROR_FAILURE;
}
if (removalIndex < removalArray.Length()) {
LOG(("There are still prefixes to remove after exhausting the old PrefixSet."));
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE,
WRONG_REMOVAL_INDICES);
return NS_ERROR_FAILURE;
}
@ -290,8 +281,6 @@ LookupCacheV4::ApplyUpdate(TableUpdateV4* aTableUpdate,
crypto->Finish(false, checksum);
if (aTableUpdate->Checksum().IsEmpty()) {
LOG(("Update checksum missing."));
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE,
MISSING_CHECKSUM);
// Generate our own checksum to tableUpdate to ensure there is always
// checksum in .metadata
@ -300,8 +289,6 @@ LookupCacheV4::ApplyUpdate(TableUpdateV4* aTableUpdate,
} else if (aTableUpdate->Checksum() != checksum){
LOG(("Checksum mismatch after applying partial update"));
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE,
CHECKSUM_MISMATCH);
return NS_ERROR_FAILURE;
}

View file

@ -37,7 +37,6 @@
#include "mozilla/Mutex.h"
#include "mozilla/Preferences.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Logging.h"
#include "prprf.h"
#include "prnetdb.h"
@ -320,9 +319,6 @@ nsUrlClassifierDBServiceWorker::HandlePendingLookups()
MutexAutoUnlock unlock(mPendingLookupLock);
DoLookup(lookup.mKey, lookup.mTables, lookup.mCallback);
}
double lookupTime = (TimeStamp::Now() - lookup.mStartTime).ToMilliseconds();
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_LOOKUP_TIME,
static_cast<uint32_t>(lookupTime));
}
return NS_OK;

View file

@ -646,9 +646,6 @@ nsUrlClassifierStreamUpdater::OnStartRequest(nsIRequest *request,
if (NS_FAILED(status)) {
// Assume we're overloading the server and trigger backoff.
downloadError = true;
mozilla::Telemetry::Accumulate(mozilla::Telemetry::URLCLASSIFIER_UPDATE_REMOTE_STATUS,
15 /* unknown response code */);
} else {
bool succeeded = false;
rv = httpChannel->GetRequestSucceeded(&succeeded);
@ -657,8 +654,6 @@ nsUrlClassifierStreamUpdater::OnStartRequest(nsIRequest *request,
uint32_t requestStatus;
rv = httpChannel->GetResponseStatus(&requestStatus);
NS_ENSURE_SUCCESS(rv, rv);
mozilla::Telemetry::Accumulate(mozilla::Telemetry::URLCLASSIFIER_UPDATE_REMOTE_STATUS,
HTTPStatusToBucket(requestStatus));
LOG(("nsUrlClassifierStreamUpdater::OnStartRequest %s (%d)", succeeded ?
"succeeded" : "failed", requestStatus));
if (!succeeded) {