Commit 9606c6d7 authored by Xi Cheng's avatar Xi Cheng Committed by Commit Bot

Record the time cost of deserializing all pending call stack profiles

Bug: 903972
Change-Id: Ib70702de4cda80970454fd5d8c296855673698cb
Reviewed-on: https://chromium-review.googlesource.com/c/1347145Reviewed-by: default avatarMike Wittman <wittman@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Commit-Queue: Xi Cheng <chengx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611182}
parent 3af66786
...@@ -9,10 +9,12 @@ ...@@ -9,10 +9,12 @@
#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 {
...@@ -113,6 +115,7 @@ std::vector<SampledProfile> PendingProfiles::RetrieveProfiles() { ...@@ -113,6 +115,7 @@ std::vector<SampledProfile> PendingProfiles::RetrieveProfiles() {
} }
// Deserialize all serialized profiles, skipping over any that fail to parse. // Deserialize all serialized profiles, skipping over any that fail to parse.
base::ElapsedTimer timer;
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) {
...@@ -122,6 +125,8 @@ std::vector<SampledProfile> PendingProfiles::RetrieveProfiles() { ...@@ -122,6 +125,8 @@ std::vector<SampledProfile> PendingProfiles::RetrieveProfiles() {
profiles.push_back(std::move(profile)); profiles.push_back(std::move(profile));
} }
} }
UMA_HISTOGRAM_TIMES("StackSamplingProfiler.DeserializeAllPendingProfilesTime",
timer.Elapsed());
return profiles; return profiles;
} }
......
...@@ -106562,6 +106562,15 @@ uploading your change for review. ...@@ -106562,6 +106562,15 @@ uploading your change for review.
</summary> </summary>
</histogram> </histogram>
<histogram name="StackSamplingProfiler.DeserializeAllPendingProfilesTime"
units="ms" expires_after="2019-05-21">
<owner>chengx@chromium.org</owner>
<owner>wittman@chromium.org</owner>
<summary>
Amount of time taken to deserialize all pending call stack profiles.
</summary>
</histogram>
<histogram name="StackSamplingProfiler.ProfileDeserializationTime" units="ms" <histogram name="StackSamplingProfiler.ProfileDeserializationTime" units="ms"
expires_after="2019-01-24"> expires_after="2019-01-24">
<obsolete> <obsolete>
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