OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
7 // | 7 // |
8 // OVERVIEW | 8 // OVERVIEW |
9 // | 9 // |
10 // A MetricsService instance is typically created at application startup. It is | 10 // A MetricsService instance is typically created at application startup. It is |
(...skipping 18 matching lines...) Expand all Loading... |
29 // external server's response to the initial log conceptually tells this MS if | 29 // external server's response to the initial log conceptually tells this MS if |
30 // it should continue transmitting logs (during this session). The server | 30 // it should continue transmitting logs (during this session). The server |
31 // response can actually be much more detailed, and always includes (at a | 31 // response can actually be much more detailed, and always includes (at a |
32 // minimum) how often additional ongoing logs should be sent. | 32 // minimum) how often additional ongoing logs should be sent. |
33 // | 33 // |
34 // After the above initial log, a series of ongoing logs will be transmitted. | 34 // After the above initial log, a series of ongoing logs will be transmitted. |
35 // The first ongoing log actually begins to accumulate information stating when | 35 // The first ongoing log actually begins to accumulate information stating when |
36 // the MS was first constructed. Note that even though the initial log is | 36 // the MS was first constructed. Note that even though the initial log is |
37 // commonly sent a full minute after startup, the initial log does not include | 37 // commonly sent a full minute after startup, the initial log does not include |
38 // much in the way of user stats. The most common interlog period (delay) | 38 // much in the way of user stats. The most common interlog period (delay) |
39 // is 20 minutes. That time period starts when the first user action causes a | 39 // is 30 minutes. That time period starts when the first user action causes a |
40 // logging event. This means that if there is no user action, there may be long | 40 // logging event. This means that if there is no user action, there may be long |
41 // periods without any (ongoing) log transmissions. Ongoing logs typically | 41 // periods without any (ongoing) log transmissions. Ongoing logs typically |
42 // contain very detailed records of user activities (ex: opened tab, closed | 42 // contain very detailed records of user activities (ex: opened tab, closed |
43 // tab, fetched URL, maximized window, etc.) In addition, just before an | 43 // tab, fetched URL, maximized window, etc.) In addition, just before an |
44 // ongoing log is closed out, a call is made to gather memory statistics. Those | 44 // ongoing log is closed out, a call is made to gather memory statistics. Those |
45 // memory statistics are deposited into a histogram, and the log finalization | 45 // memory statistics are deposited into a histogram, and the log finalization |
46 // code is then called. In the finalization, a call to a Histogram server | 46 // code is then called. In the finalization, a call to a Histogram server |
47 // acquires a list of all local histograms that have been flagged for upload | 47 // acquires a list of all local histograms that have been flagged for upload |
48 // to the UMA server. The finalization also acquires a the most recent number | 48 // to the UMA server. The finalization also acquires a the most recent number |
49 // of page loads, along with any counts of renderer or plugin crashes. | 49 // of page loads, along with any counts of renderer or plugin crashes. |
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1814 if (local_state) { | 1814 if (local_state) { |
1815 const PrefService::Preference* uma_pref = | 1815 const PrefService::Preference* uma_pref = |
1816 local_state->FindPreference(prefs::kMetricsReportingEnabled); | 1816 local_state->FindPreference(prefs::kMetricsReportingEnabled); |
1817 if (uma_pref) { | 1817 if (uma_pref) { |
1818 bool success = uma_pref->GetValue()->GetAsBoolean(&result); | 1818 bool success = uma_pref->GetValue()->GetAsBoolean(&result); |
1819 DCHECK(success); | 1819 DCHECK(success); |
1820 } | 1820 } |
1821 } | 1821 } |
1822 return result; | 1822 return result; |
1823 } | 1823 } |
OLD | NEW |