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

Unified Diff: components/metrics/profiler/tracking_synchronizer_observer.h

Issue 985773002: Introducing phased profiling framework (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@write_to_file
Patch Set: Only "API" Created 5 years, 9 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
Index: components/metrics/profiler/tracking_synchronizer_observer.h
diff --git a/components/metrics/profiler/tracking_synchronizer_observer.h b/components/metrics/profiler/tracking_synchronizer_observer.h
index b9301bb268e4d0c97319916752f2d31dd231834e..a1141dbc87f47ebed6dfce465bd115ca3d5f08de 100644
--- a/components/metrics/profiler/tracking_synchronizer_observer.h
+++ b/components/metrics/profiler/tracking_synchronizer_observer.h
@@ -5,21 +5,41 @@
#ifndef COMPONENTS_METRICS_PROFILER_TRACKING_SYNCHRONIZER_OBSERVER_H_
#define COMPONENTS_METRICS_PROFILER_TRACKING_SYNCHRONIZER_OBSERVER_H_
+#include <vector>
+
+#include "components/metrics/proto/chrome_user_metrics_extension.pb.h"
+
+namespace base {
+class TimeDelta;
+}
+
namespace tracked_objects {
-struct ProcessDataSnapshot;
+struct ProcessDataPhaseSnapshot;
}
namespace metrics {
+// Set of profiling events, in no guaranteed order.
Alexei Svitkine (slow) 2015/03/09 17:13:35 It's confusing to have something named a set when
Ilya Sherman 2015/03/10 00:48:11 Or, just call this a "list".
Ilya Sherman 2015/03/10 00:48:11 Why isn't the order guaranteed?
vadimt 2015/03/13 23:18:01 The server doesn't use order. Hence, the client ha
vadimt 2015/03/13 23:18:01 Done.
+typedef std::vector<ProfilerEventProto::ProfilerEvent> ProfilerEventsSet;
Ilya Sherman 2015/03/10 00:48:11 Definitely please don't name the type "set" if it'
vadimt 2015/03/13 23:18:02 Done.
+
// Observer for notifications from the TrackingSynchronizer class.
class TrackingSynchronizerObserver {
public:
- // Received |profiler_data| from a single process of |process_type|.
+ // Received |process_data_phase| for profiling phase |profiling_phase| from a
+ // single process of |process_type|. The phase start and finish times,
+ // relative to the start time are |profiling_phase_start| and
+ // |profiling_phase_finish|. |past_profiler_events| is the set of events that
+ // caused finishing prior profiling phases.
Ilya Sherman 2015/03/10 00:48:11 nit: This final sentence is not very clear. Pleas
vadimt 2015/03/13 23:18:02 Done.
// The observer should assume there might be more data coming until
// |FinishedReceivingData()| is called.
virtual void ReceivedProfilerData(
- const tracked_objects::ProcessDataSnapshot& profiler_data,
- int process_type) = 0;
+ const tracked_objects::ProcessDataPhaseSnapshot& process_data_phase,
Alexei Svitkine (slow) 2015/03/09 17:13:35 This is now a lot of parameters. How about definin
Ilya Sherman 2015/03/10 00:48:11 In particular, why aren't these all members of Pro
vadimt 2015/03/13 23:18:02 Because they are calculated in TrackingSynchronize
vadimt 2015/03/13 23:18:02 I don't feel very good about creating a copy of Pr
Ilya Sherman 2015/03/14 00:02:31 (a) I'd prefer to track all of this in //base, so
vadimt 2015/03/14 01:39:15 Can do, but first please confirm that you are OK w
+ int process_id,
Alexei Svitkine (slow) 2015/03/09 17:13:35 Is there a reason this is an int and not a base::P
vadimt 2015/03/13 23:18:02 Done.
+ int process_type,
Alexei Svitkine (slow) 2015/03/09 17:13:35 Again, shouldn't this be some enum type?
vadimt 2015/03/13 23:18:02 Done, but I'd rather revert it since Nacl passes v
+ int profiling_phase,
Alexei Svitkine (slow) 2015/03/09 17:13:35 Likewise - if this file is depending on the protob
vadimt 2015/03/13 23:18:01 No, this is just a number of the profiling phase.
+ const base::TimeDelta& profiling_phase_start,
+ const base::TimeDelta& profiling_phase_finish,
+ const ProfilerEventsSet& past_profiler_events) = 0;
// The observer should not expect any more calls to |ReceivedProfilerData()|
// (without re-registering). This is sent either when data from all processes

Powered by Google App Engine
This is Rietveld 408576698