Skip to content

Commit

Permalink
[Extensions] Remove multiple expired histograms.
Browse files Browse the repository at this point in the history
Metrics removed:
  Extensions.SandboxUnpackHashCheck
  Extensions.ExternalJsonCount
  Extensions.ContentVerification.ReadContentHashTime
  ExtensionContentVerifyJob.TimeSpentUS

All of these do not seem to have an immediate known usage and have been
expired for years at this point.

Fixed: 1499402, 1499396, 1499390, 1499387
Change-Id: I9e4be9f8f95022783dc64c8d0cfd9fc98e5dc58d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5030769
Reviewed-by: David Bertoni <[email protected]>
Commit-Queue: Justin Lulejian <[email protected]>
Auto-Submit: Justin Lulejian <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1226618}
  • Loading branch information
Justin Lulejian authored and Chromium LUCI CQ committed Nov 19, 2023
1 parent 51a17ea commit 2f3e238
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 59 deletions.
3 changes: 0 additions & 3 deletions chrome/browser/extensions/external_pref_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,6 @@ void ExternalPrefLoader::LoadOnFileThread() {
ReadStandaloneExtensionPrefFiles(prefs);
}

if (base_path_id_ == chrome::DIR_EXTERNAL_EXTENSIONS)
UMA_HISTOGRAM_COUNTS_100("Extensions.ExternalJsonCount", prefs.size());

// If we have any records to process, then we must have
// read at least one .json file. If so, then we should have
// set |base_path_|.
Expand Down
6 changes: 0 additions & 6 deletions extensions/browser/content_verifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_restrictions.h"
#include "base/timer/elapsed_timer.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
Expand Down Expand Up @@ -288,13 +287,10 @@ class ContentVerifier::HashHelper {

void Cancel() { cancelled_checker->Cancel(); }

base::TimeDelta elapsed() const { return elapsed_timer.Elapsed(); }

scoped_refptr<IsCancelledChecker> cancelled_checker;
// TODO(lazyboy): Use std::list?
std::vector<ContentHashCallback> callbacks;
bool force_missing_computed_hashes_creation = false;
base::ElapsedTimer elapsed_timer;
};

using IsCancelledCallback = base::RepeatingCallback<bool(void)>;
Expand Down Expand Up @@ -387,8 +383,6 @@ class ContentVerifier::HashHelper {
auto iter = callback_infos_.find(key);
DCHECK(iter != callback_infos_.end());
auto& callback_info = iter->second;
UMA_HISTOGRAM_TIMES("Extensions.ContentVerification.ReadContentHashTime",
callback_info.elapsed());

for (auto& callback : callback_info.callbacks)
std::move(callback).Run(content_hash);
Expand Down
5 changes: 1 addition & 4 deletions extensions/browser/content_verify_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ ContentVerifyJob::ContentVerifyJob(const ExtensionId& extension_id,
failure_callback_(std::move(failure_callback)),
failed_(false) {}

ContentVerifyJob::~ContentVerifyJob() {
UMA_HISTOGRAM_COUNTS_1M("ExtensionContentVerifyJob.TimeSpentUS",
time_spent_.InMicroseconds());
}
ContentVerifyJob::~ContentVerifyJob() = default;

void ContentVerifyJob::Start(ContentVerifier* verifier) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
Expand Down
3 changes: 0 additions & 3 deletions extensions/browser/sandboxed_unpacker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -953,8 +953,6 @@ bool SandboxedUnpacker::ValidateSignature(

switch (result) {
case crx_file::VerifierResult::OK_FULL: {
if (!expected_hash.empty())
UMA_HISTOGRAM_BOOLEAN("Extensions.SandboxUnpackHashCheck", true);
return true;
}
case crx_file::VerifierResult::OK_DELTA:
Expand Down Expand Up @@ -989,7 +987,6 @@ bool SandboxedUnpacker::ValidateSignature(
// We should never get this result unless we had specifically asked for
// verification of the crx file's hash.
CHECK(!expected_hash.empty());
UMA_HISTOGRAM_BOOLEAN("Extensions.SandboxUnpackHashCheck", false);
FailWithPackageError(
SandboxedUnpackerFailureReason::CRX_HASH_VERIFICATION_FAILED);
break;
Expand Down
43 changes: 0 additions & 43 deletions tools/metrics/histograms/metadata/extensions/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,6 @@ [email protected].
</summary>
</histogram>

<histogram name="ExtensionContentVerifyJob.TimeSpentUS" units="microseconds"
expires_after="2020-11-30">
<owner>[email protected]</owner>
<summary>
The time taken in computation (hashing actual bytes read and comparing
against expected computed hashes values) during an extension resource load.

Warning: This metric may include reports from clients with low-resolution
clocks (i.e. on Windows, ref. |TimeTicks::IsHighResolution()|). Such reports
will cause this metric to have an abnormal distribution. When considering
revising this histogram, see UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES for the
solution.
</summary>
</histogram>

<histogram name="Extensions.ActiveScriptController.DeniedExtensions"
units="Extension Count" expires_after="2024-03-31">
<owner>[email protected]</owner>
Expand Down Expand Up @@ -398,17 +383,6 @@ [email protected].
</summary>
</histogram>

<histogram name="Extensions.ContentVerification.ReadContentHashTime" units="ms"
expires_after="2020-11-30">
<owner>[email protected]</owner>
<owner>[email protected]</owner>
<summary>
Time spent by ContentVerifier for a request to create a ContentHash
instance. Recorded during an extension load completion or during an on
demand content verification that was triggered by ContentVerifyJob.
</summary>
</histogram>

<histogram name="Extensions.ContextMenuAction"
enum="ExtensionContextMenuAction" expires_after="never">
<!-- expires-never: Monitoring extension usage. -->
Expand Down Expand Up @@ -1551,15 +1525,6 @@ [email protected].
</summary>
</histogram>

<histogram name="Extensions.ExternalJsonCount" units="units"
expires_after="M77">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<summary>
Number of extensions referenced in the external extensions source at path
chrome::DIR_EXTERNAL_EXTENSIONS.
</summary>
</histogram>

<histogram name="Extensions.FaviconResourceRequested" enum="ExtensionType"
expires_after="2021-01-31">
<owner>[email protected]</owner>
Expand Down Expand Up @@ -3967,14 +3932,6 @@ [email protected].
</summary>
</histogram>

<histogram name="Extensions.SandboxUnpackHashCheck" enum="BooleanValidHashSum"
expires_after="M85">
<owner>[email protected]</owner>
<summary>
Whether a CRX file hash sum was the same as in an updater manifest.
</summary>
</histogram>

<histogram name="Extensions.SandboxUnpackSuccess" units="units"
expires_after="never">
<!-- expires-never: Monitors core extension installation flows. -->
Expand Down

0 comments on commit 2f3e238

Please sign in to comment.