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

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: Fixing Android compile errors. 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..0e943508079bd814169fae18b759ff563f74c21f 100644
--- a/components/metrics/profiler/tracking_synchronizer_observer.h
+++ b/components/metrics/profiler/tracking_synchronizer_observer.h
@@ -5,21 +5,53 @@
#ifndef COMPONENTS_METRICS_PROFILER_TRACKING_SYNCHRONIZER_OBSERVER_H_
#define COMPONENTS_METRICS_PROFILER_TRACKING_SYNCHRONIZER_OBSERVER_H_
+#include <vector>
+
+#include "base/process/process_handle.h"
+#include "components/metrics/proto/chrome_user_metrics_extension.pb.h"
+#include "content/public/common/process_type.h"
+
+namespace base {
+class TimeDelta;
+}
+
namespace tracked_objects {
-struct ProcessDataSnapshot;
+struct ProcessDataPhaseSnapshot;
}
namespace metrics {
+// Set of profiling events, in no guaranteed order. Implemented as a vector
+// because we don't need to have an efficient .find() on it, so vector<> is more
+// efficient.
+typedef std::vector<ProfilerEventProto::ProfilerEvent> ProfilerEvents;
+
// Observer for notifications from the TrackingSynchronizer class.
class TrackingSynchronizerObserver {
public:
- // Received |profiler_data| from a single process of |process_type|.
+ // TODO(vadimt): Consider isherman@ idea: I'd change the phase_start and
+ // phase_finish from TimeDeltas to TimeTicks. And I'd omit the |past_events|
+ // list -- either in favor of a single ProfilerEvent that corresponds to the
+ // phase, or a method on the TrackingSynchronizer that can translate a
+ // profiling_phase to a ProfilerEvent.
+
+ // 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 |phase_start| and
+ // |phase_finish|. All profiling phases prior to the reported one have already
+ // completed, and each completion was associated with an instance of
+ // ProfilerEventProto::ProfilerEvent. |past_events| contains events associated
+ // with completions of phases prior to the reported one.
// The observer should assume there might be more data coming until
- // |FinishedReceivingData()| is called.
+ // FinishedReceivingData() is called.
virtual void ReceivedProfilerData(
- const tracked_objects::ProcessDataSnapshot& profiler_data,
- int process_type) = 0;
+ const tracked_objects::ProcessDataPhaseSnapshot& process_data_phase,
+ base::ProcessId process_id,
+ content::ProcessType process_type,
+ int profiling_phase,
+ base::TimeDelta phase_start,
+ base::TimeDelta phase_finish,
+ const ProfilerEvents& past_events) = 0;
// The observer should not expect any more calls to |ReceivedProfilerData()|
// (without re-registering). This is sent either when data from all processes
« no previous file with comments | « components/metrics/profiler/tracking_synchronizer.cc ('k') | components/metrics/profiler/tracking_synchronizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698