Commit 9e3805f6 authored by Varun Khaneja's avatar Varun Khaneja Committed by Commit Bot

PVer4: Remove some unused metrics.

Remove some metrics that are not very useful and not monitored.

R=drubery

Bug: 975066,974981,972786,969971,969968,969923,833706
Change-Id: I6b30628363cf21080818a9b5345da1acc09fcabd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1677225
Auto-Submit: Varun Khaneja <vakh@chromium.org>
Reviewed-by: default avatarDaniel Rubery <drubery@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Steven Holte <holte@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672728}
parent 126220d3
...@@ -39,7 +39,6 @@ const char kDecodeAdditions[] = ".DecodeAdditions"; ...@@ -39,7 +39,6 @@ const char kDecodeAdditions[] = ".DecodeAdditions";
const char kDecodeRemovals[] = ".DecodeRemovals"; const char kDecodeRemovals[] = ".DecodeRemovals";
// Part 3: Represent the unit of value being measured and logged. // Part 3: Represent the unit of value being measured and logged.
const char kResult[] = ".Result"; const char kResult[] = ".Result";
const char kTime[] = ".Time";
// Part 4 (optional): Represent the name of the list for which the metric is // Part 4 (optional): Represent the name of the list for which the metric is
// being logged. For instance, ".UrlSoceng". // being logged. For instance, ".UrlSoceng".
// UMA metric names for this file are generated by appending one value each, // UMA metric names for this file are generated by appending one value each,
...@@ -54,32 +53,6 @@ const uint32_t kFileVersion = 9; ...@@ -54,32 +53,6 @@ const uint32_t kFileVersion = 9;
// The maximum store file size, as of today, is about 6MB. // The maximum store file size, as of today, is about 6MB.
constexpr size_t kMaxStoreSizeBytes = 50 * 1000 * 1000; constexpr size_t kMaxStoreSizeBytes = 50 * 1000 * 1000;
void RecordTimeWithAndWithoutSuffix(const std::string& metric,
base::TimeDelta time,
const base::FilePath& file_path) {
// The histograms below are a modified expansion of the
// UMA_HISTOGRAM_LONG_TIMES macro adapted to allow for a dynamically suffixed
// histogram name.
// Note: The factory creates and owns the histogram.
const int kBucketCount = 100;
base::HistogramBase* histogram = base::Histogram::FactoryTimeGet(
metric + kTime, base::TimeDelta::FromMilliseconds(1),
base::TimeDelta::FromMinutes(1), kBucketCount,
base::HistogramBase::kUmaTargetedHistogramFlag);
if (histogram) {
histogram->AddTime(time);
}
std::string suffix = GetUmaSuffixForStore(file_path);
base::HistogramBase* histogram_suffix = base::Histogram::FactoryTimeGet(
metric + kTime + suffix, base::TimeDelta::FromMilliseconds(1),
base::TimeDelta::FromMinutes(1), kBucketCount,
base::HistogramBase::kUmaTargetedHistogramFlag);
if (histogram_suffix) {
histogram_suffix->AddTime(time);
}
}
void RecordEnumWithAndWithoutSuffix(const std::string& metric, void RecordEnumWithAndWithoutSuffix(const std::string& metric,
int32_t value, int32_t value,
int32_t maximum, int32_t maximum,
...@@ -130,12 +103,6 @@ void RecordApplyUpdateResult(const std::string& base_metric, ...@@ -130,12 +103,6 @@ void RecordApplyUpdateResult(const std::string& base_metric,
APPLY_UPDATE_RESULT_MAX, file_path); APPLY_UPDATE_RESULT_MAX, file_path);
} }
void RecordApplyUpdateTime(const std::string& base_metric,
base::TimeDelta time,
const base::FilePath& file_path) {
RecordTimeWithAndWithoutSuffix(base_metric + kApplyUpdate, time, file_path);
}
void RecordDecodeAdditionsResult(const std::string& base_metric, void RecordDecodeAdditionsResult(const std::string& base_metric,
V4DecodeResult result, V4DecodeResult result,
const base::FilePath& file_path) { const base::FilePath& file_path) {
...@@ -143,13 +110,6 @@ void RecordDecodeAdditionsResult(const std::string& base_metric, ...@@ -143,13 +110,6 @@ void RecordDecodeAdditionsResult(const std::string& base_metric,
DECODE_RESULT_MAX, file_path); DECODE_RESULT_MAX, file_path);
} }
void RecordDecodeAdditionsTime(const std::string& base_metric,
base::TimeDelta time,
const base::FilePath& file_path) {
RecordTimeWithAndWithoutSuffix(base_metric + kDecodeAdditions, time,
file_path);
}
void RecordDecodeRemovalsResult(const std::string& base_metric, void RecordDecodeRemovalsResult(const std::string& base_metric,
V4DecodeResult result, V4DecodeResult result,
const base::FilePath& file_path) { const base::FilePath& file_path) {
...@@ -157,13 +117,6 @@ void RecordDecodeRemovalsResult(const std::string& base_metric, ...@@ -157,13 +117,6 @@ void RecordDecodeRemovalsResult(const std::string& base_metric,
DECODE_RESULT_MAX, file_path); DECODE_RESULT_MAX, file_path);
} }
void RecordDecodeRemovalsTime(const std::string& base_metric,
base::TimeDelta time,
const base::FilePath& file_path) {
RecordTimeWithAndWithoutSuffix(base_metric + kDecodeRemovals, time,
file_path);
}
void RecordStoreReadResult(StoreReadResult result) { void RecordStoreReadResult(StoreReadResult result) {
UMA_HISTOGRAM_ENUMERATION("SafeBrowsing.V4StoreRead.Result", result, UMA_HISTOGRAM_ENUMERATION("SafeBrowsing.V4StoreRead.Result", result,
STORE_READ_RESULT_MAX); STORE_READ_RESULT_MAX);
...@@ -310,7 +263,6 @@ ApplyUpdateResult V4Store::ProcessUpdate( ...@@ -310,7 +263,6 @@ ApplyUpdateResult V4Store::ProcessUpdate(
DCHECK(removal.has_rice_indices()); DCHECK(removal.has_rice_indices());
const RiceDeltaEncoding& rice_indices = removal.rice_indices(); const RiceDeltaEncoding& rice_indices = removal.rice_indices();
TimeTicks before = TimeTicks::Now();
V4DecodeResult decode_result = V4RiceDecoder::DecodeIntegers( V4DecodeResult decode_result = V4RiceDecoder::DecodeIntegers(
rice_indices.first_value(), rice_indices.rice_parameter(), rice_indices.first_value(), rice_indices.rice_parameter(),
rice_indices.num_entries(), rice_indices.encoded_data(), rice_indices.num_entries(), rice_indices.encoded_data(),
...@@ -320,7 +272,6 @@ ApplyUpdateResult V4Store::ProcessUpdate( ...@@ -320,7 +272,6 @@ ApplyUpdateResult V4Store::ProcessUpdate(
if (decode_result != DECODE_SUCCESS) { if (decode_result != DECODE_SUCCESS) {
return RICE_DECODING_FAILURE; return RICE_DECODING_FAILURE;
} }
RecordDecodeRemovalsTime(metric, TimeTicks::Now() - before, store_path_);
raw_removals = &rice_removals; raw_removals = &rice_removals;
} else { } else {
NOTREACHED() << "Unexpected compression_type type: " << compression_type; NOTREACHED() << "Unexpected compression_type type: " << compression_type;
...@@ -371,7 +322,6 @@ void V4Store::ApplyUpdate( ...@@ -371,7 +322,6 @@ void V4Store::ApplyUpdate(
new V4Store(task_runner_, store_path_, file_size_)); new V4Store(task_runner_, store_path_, file_size_));
ApplyUpdateResult apply_update_result; ApplyUpdateResult apply_update_result;
std::string metric; std::string metric;
TimeTicks before = TimeTicks::Now();
if (response->response_type() == ListUpdateResponse::PARTIAL_UPDATE) { if (response->response_type() == ListUpdateResponse::PARTIAL_UPDATE) {
metric = kProcessPartialUpdate; metric = kProcessPartialUpdate;
apply_update_result = new_store->ProcessPartialUpdateAndWriteToDisk( apply_update_result = new_store->ProcessPartialUpdateAndWriteToDisk(
...@@ -391,7 +341,6 @@ void V4Store::ApplyUpdate( ...@@ -391,7 +341,6 @@ void V4Store::ApplyUpdate(
new_store->last_apply_update_result_ = apply_update_result; new_store->last_apply_update_result_ = apply_update_result;
new_store->last_apply_update_time_millis_ = base::Time::Now(); new_store->last_apply_update_time_millis_ = base::Time::Now();
new_store->checks_attempted_ = checks_attempted_; new_store->checks_attempted_ = checks_attempted_;
RecordApplyUpdateTime(metric, TimeTicks::Now() - before, store_path_);
} else { } else {
new_store.reset(); new_store.reset();
DLOG(WARNING) << "Failure: ApplyUpdate: reason: " << apply_update_result DLOG(WARNING) << "Failure: ApplyUpdate: reason: " << apply_update_result
...@@ -430,7 +379,6 @@ ApplyUpdateResult V4Store::UpdateHashPrefixMapFromAdditions( ...@@ -430,7 +379,6 @@ ApplyUpdateResult V4Store::UpdateHashPrefixMapFromAdditions(
const RiceDeltaEncoding& rice_hashes = addition.rice_hashes(); const RiceDeltaEncoding& rice_hashes = addition.rice_hashes();
std::vector<uint32_t> raw_hashes; std::vector<uint32_t> raw_hashes;
TimeTicks before = TimeTicks::Now();
V4DecodeResult decode_result = V4RiceDecoder::DecodePrefixes( V4DecodeResult decode_result = V4RiceDecoder::DecodePrefixes(
rice_hashes.first_value(), rice_hashes.rice_parameter(), rice_hashes.first_value(), rice_hashes.rice_parameter(),
rice_hashes.num_entries(), rice_hashes.encoded_data(), &raw_hashes); rice_hashes.num_entries(), rice_hashes.encoded_data(), &raw_hashes);
...@@ -438,8 +386,6 @@ ApplyUpdateResult V4Store::UpdateHashPrefixMapFromAdditions( ...@@ -438,8 +386,6 @@ ApplyUpdateResult V4Store::UpdateHashPrefixMapFromAdditions(
if (decode_result != DECODE_SUCCESS) { if (decode_result != DECODE_SUCCESS) {
return RICE_DECODING_FAILURE; return RICE_DECODING_FAILURE;
} else { } else {
RecordDecodeAdditionsTime(metric, TimeTicks::Now() - before,
store_path_);
char* raw_hashes_start = reinterpret_cast<char*>(raw_hashes.data()); char* raw_hashes_start = reinterpret_cast<char*>(raw_hashes.data());
size_t raw_hashes_size = sizeof(uint32_t) * raw_hashes.size(); size_t raw_hashes_size = sizeof(uint32_t) * raw_hashes.size();
...@@ -686,7 +632,6 @@ StoreReadResult V4Store::ReadFromDisk() { ...@@ -686,7 +632,6 @@ StoreReadResult V4Store::ReadFromDisk() {
V4StoreFileFormat file_format; V4StoreFileFormat file_format;
int64_t file_size; int64_t file_size;
TimeTicks before = TimeTicks::Now();
{ {
// A temporary scope to make sure that |contents| get destroyed as soon as // A temporary scope to make sure that |contents| get destroyed as soon as
// we are doing using it. // we are doing using it.
...@@ -730,7 +675,6 @@ StoreReadResult V4Store::ReadFromDisk() { ...@@ -730,7 +675,6 @@ StoreReadResult V4Store::ReadFromDisk() {
hash_prefix_map_.clear(); hash_prefix_map_.clear();
return HASH_PREFIX_MAP_GENERATION_FAILURE; return HASH_PREFIX_MAP_GENERATION_FAILURE;
} }
RecordApplyUpdateTime(kReadFromDisk, TimeTicks::Now() - before, store_path_);
// Update |file_size_| now because we parsed the file correctly. // Update |file_size_| now because we parsed the file correctly.
file_size_ = file_size; file_size_ = file_size;
......
...@@ -110153,8 +110153,10 @@ uploading your change for review. ...@@ -110153,8 +110153,10 @@ uploading your change for review.
</summary> </summary>
</histogram> </histogram>
<histogram name="SafeBrowsing.V4ProcessFullUpdate.ApplyUpdate.Time" units="ms" <histogram name="SafeBrowsing.V4ProcessFullUpdate.ApplyUpdate.Time" units="ms">
expires_after="M77"> <obsolete>
Removed in M77 due to lack of use.
</obsolete>
<owner>vakh@chromium.org</owner> <owner>vakh@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner>
<summary> <summary>
...@@ -110179,7 +110181,10 @@ uploading your change for review. ...@@ -110179,7 +110181,10 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="SafeBrowsing.V4ProcessFullUpdate.DecodeAdditions.Time" <histogram name="SafeBrowsing.V4ProcessFullUpdate.DecodeAdditions.Time"
units="ms" expires_after="M77"> units="ms">
<obsolete>
Removed in M77 due to lack of use.
</obsolete>
<owner>vakh@chromium.org</owner> <owner>vakh@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner>
<summary> <summary>
...@@ -110225,7 +110230,10 @@ uploading your change for review. ...@@ -110225,7 +110230,10 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="SafeBrowsing.V4ProcessPartialUpdate.ApplyUpdate.Time" <histogram name="SafeBrowsing.V4ProcessPartialUpdate.ApplyUpdate.Time"
units="ms" expires_after="M77"> units="ms">
<obsolete>
Removed in M77 due to lack of use.
</obsolete>
<owner>vakh@chromium.org</owner> <owner>vakh@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner>
<summary> <summary>
...@@ -110252,7 +110260,10 @@ uploading your change for review. ...@@ -110252,7 +110260,10 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="SafeBrowsing.V4ProcessPartialUpdate.DecodeAdditions.Time" <histogram name="SafeBrowsing.V4ProcessPartialUpdate.DecodeAdditions.Time"
units="ms" expires_after="M77"> units="ms">
<obsolete>
Removed in M77 due to lack of use.
</obsolete>
<owner>vakh@chromium.org</owner> <owner>vakh@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner>
<summary> <summary>
...@@ -110273,7 +110284,10 @@ uploading your change for review. ...@@ -110273,7 +110284,10 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="SafeBrowsing.V4ProcessPartialUpdate.DecodeRemovals.Time" <histogram name="SafeBrowsing.V4ProcessPartialUpdate.DecodeRemovals.Time"
units="ms" expires_after="M77"> units="ms">
<obsolete>
Removed in M77 due to lack of use.
</obsolete>
<owner>vakh@chromium.org</owner> <owner>vakh@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner>
<summary> <summary>
...@@ -110319,8 +110333,10 @@ uploading your change for review. ...@@ -110319,8 +110333,10 @@ uploading your change for review.
</summary> </summary>
</histogram> </histogram>
<histogram name="SafeBrowsing.V4ReadFromDisk.ApplyUpdate.Time" units="ms" <histogram name="SafeBrowsing.V4ReadFromDisk.ApplyUpdate.Time" units="ms">
expires_after="M77"> <obsolete>
Removed in M77 due to lack of use.
</obsolete>
<owner>vakh@chromium.org</owner> <owner>vakh@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner>
<summary> <summary>
...@@ -110344,8 +110360,10 @@ uploading your change for review. ...@@ -110344,8 +110360,10 @@ uploading your change for review.
</summary> </summary>
</histogram> </histogram>
<histogram name="SafeBrowsing.V4ReadFromDisk.DecodeAdditions.Time" units="ms" <histogram name="SafeBrowsing.V4ReadFromDisk.DecodeAdditions.Time" units="ms">
expires_after="M77"> <obsolete>
Removed in M77 due to lack of use.
</obsolete>
<owner>vakh@chromium.org</owner> <owner>vakh@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner>
<summary> <summary>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment