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

Unified Diff: base/tracking_info.h

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/tracked_objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/tracking_info.h
diff --git a/base/tracking_info.h b/base/tracking_info.h
index dacbcea1d2b9d83a4734b5c5b21216f4cac004f7..ba9585e6d9b7d6a8105a9c427d121d038c388b8f 100644
--- a/base/tracking_info.h
+++ b/base/tracking_info.h
@@ -11,6 +11,7 @@
#ifndef BASE_TRACKING_INFO_H_
#define BASE_TRACKING_INFO_H_
+#include "base/profiler/tracked_time.h"
#include "base/time/time.h"
namespace tracked_objects {
@@ -27,6 +28,17 @@ struct BASE_EXPORT TrackingInfo {
base::TimeTicks delayed_run_time);
~TrackingInfo();
+ // 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 queuing 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 queuing delay.
+ tracked_objects::TrackedTime EffectiveTimePosted() const {
+ return tracked_objects::TrackedTime(
+ delayed_run_time.is_null() ? time_posted : delayed_run_time);
+ }
+
// Record of location and thread that the task came from.
tracked_objects::Births* birth_tally;
« no previous file with comments | « base/tracked_objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698