Commit 40b6833a authored by Xi Cheng's avatar Xi Cheng Committed by Commit Bot

Retire call stack profile serialization/deserialization metrics

StackSamplingProfiler.ProfileDeserializationTime is recorded for every
profile to deserialize, which can be expensive when a lot of profiles
are pending upload. Since we have already got enough data for these
metrics, we should retire them.

Bug: 851163
Change-Id: I703e8b01752832d9574e804b1a28c2a2bfd0058e
Reviewed-on: https://chromium-review.googlesource.com/c/1332772
Commit-Queue: Xi Cheng <chengx@chromium.org>
Reviewed-by: default avatarMike Wittman <wittman@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607450}
parent bbacb1fc
...@@ -9,12 +9,10 @@ ...@@ -9,12 +9,10 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "base/synchronization/lock.h" #include "base/synchronization/lock.h"
#include "base/thread_annotations.h" #include "base/thread_annotations.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/timer/elapsed_timer.h"
#include "third_party/metrics_proto/chrome_user_metrics_extension.pb.h" #include "third_party/metrics_proto/chrome_user_metrics_extension.pb.h"
namespace metrics { namespace metrics {
...@@ -117,12 +115,9 @@ std::vector<SampledProfile> PendingProfiles::RetrieveProfiles() { ...@@ -117,12 +115,9 @@ std::vector<SampledProfile> PendingProfiles::RetrieveProfiles() {
std::vector<SampledProfile> profiles; std::vector<SampledProfile> profiles;
profiles.reserve(serialized_profiles.size()); profiles.reserve(serialized_profiles.size());
for (const auto& serialized_profile : serialized_profiles) { for (const auto& serialized_profile : serialized_profiles) {
base::ElapsedTimer timer;
SampledProfile profile; SampledProfile profile;
if (profile.ParseFromArray(serialized_profile.data(), if (profile.ParseFromArray(serialized_profile.data(),
serialized_profile.size())) { serialized_profile.size())) {
UMA_HISTOGRAM_TIMES("StackSamplingProfiler.ProfileDeserializationTime",
timer.Elapsed());
profiles.push_back(std::move(profile)); profiles.push_back(std::move(profile));
} }
} }
...@@ -180,11 +175,8 @@ void PendingProfiles::MaybeCollectProfile(base::TimeTicks profile_start_time, ...@@ -180,11 +175,8 @@ void PendingProfiles::MaybeCollectProfile(base::TimeTicks profile_start_time,
} }
// Serialize the profile without holding the lock. // Serialize the profile without holding the lock.
base::ElapsedTimer timer;
std::string serialized_profile; std::string serialized_profile;
profile.SerializeToString(&serialized_profile); profile.SerializeToString(&serialized_profile);
UMA_HISTOGRAM_TIMES("StackSamplingProfiler.ProfileSerializationTime",
timer.Elapsed());
MaybeCollectSerializedProfile(profile_start_time, MaybeCollectSerializedProfile(profile_start_time,
std::move(serialized_profile)); std::move(serialized_profile));
......
...@@ -105462,6 +105462,9 @@ uploading your change for review. ...@@ -105462,6 +105462,9 @@ uploading your change for review.
<histogram name="StackSamplingProfiler.ProfileDeserializationTime" units="ms" <histogram name="StackSamplingProfiler.ProfileDeserializationTime" units="ms"
expires_after="2019-01-24"> expires_after="2019-01-24">
<obsolete>
Removed 11/2018 as we no longer record this metric.
</obsolete>
<owner>chengx@chromium.org</owner> <owner>chengx@chromium.org</owner>
<owner>wittman@chromium.org</owner> <owner>wittman@chromium.org</owner>
<summary> <summary>
...@@ -105471,6 +105474,9 @@ uploading your change for review. ...@@ -105471,6 +105474,9 @@ uploading your change for review.
<histogram name="StackSamplingProfiler.ProfileSerializationTime" units="ms" <histogram name="StackSamplingProfiler.ProfileSerializationTime" units="ms"
expires_after="2019-01-24"> expires_after="2019-01-24">
<obsolete>
Removed 11/2018 as we no longer record this metric.
</obsolete>
<owner>chengx@chromium.org</owner> <owner>chengx@chromium.org</owner>
<owner>wittman@chromium.org</owner> <owner>wittman@chromium.org</owner>
<summary>Amount of time taken to serialize a call stack profile.</summary> <summary>Amount of time taken to serialize a call stack profile.</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