OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ | 5 #ifndef COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ |
6 #define COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ | 6 #define COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "components/metrics/metrics_provider.h" | 10 #include "components/metrics/metrics_provider.h" |
11 | 11 |
12 namespace browser_watcher { | 12 namespace browser_watcher { |
13 | 13 |
14 // Provides stability data captured by the Chrome Watcher, namely the browser | 14 // Provides stability data captured by the Chrome Watcher, namely the browser |
15 // process exit codes. | 15 // process exit codes, as well as exit funnel metrics. |
| 16 // The exit funnel records a trace of named, timed events in registry per |
| 17 // process. For reporting, the trace is recorded as a sequence of events |
| 18 // named Stability.ExitFunnel.<eventname>, associated to the time |
| 19 // (in milliseconds) from first event in a trace. For a normal process exit, |
| 20 // the sequence might look like this: |
| 21 // - Stability.ExitFunnel.Logoff: 0 |
| 22 // - Stability.ExitFunnel.NotifyShutdown: 10 |
| 23 // - Stability.ExitFunnel.EndSession: 20 |
| 24 // - Stability.ExitFunnel.KillProcess: 30 |
16 class WatcherMetricsProviderWin : public metrics::MetricsProvider { | 25 class WatcherMetricsProviderWin : public metrics::MetricsProvider { |
17 public: | 26 public: |
18 static const char kBrowserExitCodeHistogramName[]; | 27 static const char kBrowserExitCodeHistogramName[]; |
| 28 static const char kExitFunnelHistogramPrefix[]; |
19 | 29 |
20 explicit WatcherMetricsProviderWin(const base::char16* registry_path); | 30 explicit WatcherMetricsProviderWin(const base::char16* registry_path); |
21 ~WatcherMetricsProviderWin(); | 31 ~WatcherMetricsProviderWin(); |
22 | 32 |
23 // metrics::MetricsProvider implementation. | 33 // metrics::MetricsProvider implementation. |
24 virtual void ProvideStabilityMetrics( | 34 virtual void ProvideStabilityMetrics( |
25 metrics::SystemProfileProto* system_profile_proto) override; | 35 metrics::SystemProfileProto* system_profile_proto) override; |
26 | 36 |
27 private: | 37 private: |
28 base::string16 registry_path_; | 38 base::string16 registry_path_; |
29 | 39 |
30 DISALLOW_COPY_AND_ASSIGN(WatcherMetricsProviderWin); | 40 DISALLOW_COPY_AND_ASSIGN(WatcherMetricsProviderWin); |
31 }; | 41 }; |
32 | 42 |
33 } // namespace browser_watcher | 43 } // namespace browser_watcher |
34 | 44 |
35 #endif // COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ | 45 #endif // COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ |
OLD | NEW |