Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1936)

Unified Diff: base/tracked_objects.cc

Issue 18083015: Add queued_time_ms trace for events in message loop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/message_loop/message_loop.cc ('k') | base/tracking_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/tracked_objects.cc
diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc
index c45276b04d42e2588b447890fdfa9a4c8985ee06..cc00ce608143f0736753bf0f1a50418ccd9d8318 100644
--- a/base/tracked_objects.cc
+++ b/base/tracked_objects.cc
@@ -465,16 +465,6 @@ void ThreadData::TallyRunOnNamedThreadIfTracking(
if (!current_thread_data)
return;
- // To avoid conflating our stats with the delay duration in a PostDelayedTask,
- // we identify such tasks, and replace their post_time with the time they
- // were scheduled (requested?) to emerge from the delayed task queue. This
- // means that queueing delay for such tasks will show how long they went
- // unserviced, after they *could* be serviced. This is the same stat as we
- // have for non-delayed tasks, and we consistently call it queueing delay.
- TrackedTime effective_post_time = completed_task.delayed_run_time.is_null()
- ? tracked_objects::TrackedTime(completed_task.time_posted)
- : tracked_objects::TrackedTime(completed_task.delayed_run_time);
-
// Watch out for a race where status_ is changing, and hence one or both
// of start_of_run or end_of_run is zero. In that case, we didn't bother to
// get a time value since we "weren't tracking" and we were trying to be
@@ -483,7 +473,8 @@ void ThreadData::TallyRunOnNamedThreadIfTracking(
int32 queue_duration = 0;
int32 run_duration = 0;
if (!start_of_run.is_null()) {
- queue_duration = (start_of_run - effective_post_time).InMilliseconds();
+ queue_duration = (start_of_run - completed_task.EffectiveTimePosted())
+ .InMilliseconds();
if (!end_of_run.is_null())
run_duration = (end_of_run - start_of_run).InMilliseconds();
}
« no previous file with comments | « base/message_loop/message_loop.cc ('k') | base/tracking_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698