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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_
6 #define COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_
8 #include "base/macros.h"
9 #include "base/strings/string16.h"
10 #include "components/metrics/metrics_provider.h"
12 namespace browser_watcher
{
14 // Provides stability data captured by the Chrome Watcher, namely the browser
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
25 class WatcherMetricsProviderWin
: public metrics::MetricsProvider
{
27 static const char kBrowserExitCodeHistogramName
[];
28 static const char kExitFunnelHistogramPrefix
[];
30 // Initializes the reporter. If |report_exit_funnels| is false, the provider
31 // will clear the registry data, but not report it.
32 WatcherMetricsProviderWin(const base::char16
* registry_path
,
33 bool report_exit_funnels
);
34 ~WatcherMetricsProviderWin();
36 // metrics::MetricsProvider implementation.
37 virtual void ProvideStabilityMetrics(
38 metrics::SystemProfileProto
* system_profile_proto
) override
;
41 base::string16 registry_path_
;
42 bool report_exit_funnels_
;
44 DISALLOW_COPY_AND_ASSIGN(WatcherMetricsProviderWin
);
47 } // namespace browser_watcher
49 #endif // COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_