OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" | 5 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/cpu.h" | 11 #include "base/cpu.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/metrics/sparse_histogram.h" | 13 #include "base/metrics/sparse_histogram.h" |
14 #include "base/sys_info.h" | 14 #include "base/sys_info.h" |
15 #include "base/threading/sequenced_worker_pool.h" | 15 #include "base/threading/sequenced_worker_pool.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "chrome/browser/about_flags.h" | 17 #include "chrome/browser/about_flags.h" |
18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
19 #include "chrome/browser/chrome_browser_main.h" | 19 #include "chrome/browser/chrome_browser_main.h" |
20 #include "chrome/browser/chrome_browser_metrics_service_observer.h" | 20 #include "chrome/browser/chrome_browser_metrics_service_observer.h" |
| 21 #include "chrome/browser/mac/bluetooth_utility.h" |
21 #include "chrome/browser/pref_service_flags_storage.h" | 22 #include "chrome/browser/pref_service_flags_storage.h" |
22 #include "chrome/browser/shell_integration.h" | 23 #include "chrome/browser/shell_integration.h" |
23 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
24 #include "ui/base/touch/touch_device.h" | 25 #include "ui/base/touch/touch_device.h" |
25 #include "ui/base/ui_base_switches.h" | 26 #include "ui/base/ui_base_switches.h" |
26 #include "ui/events/event_switches.h" | 27 #include "ui/events/event_switches.h" |
27 | 28 |
28 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 29 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
29 #include <gnu/libc-version.h> | 30 #include <gnu/libc-version.h> |
30 | 31 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 UMA_HISTOGRAM_SPARSE_SLOWLY("Platform.LogicalCpuCount", | 88 UMA_HISTOGRAM_SPARSE_SLOWLY("Platform.LogicalCpuCount", |
88 base::SysInfo::NumberOfProcessors()); | 89 base::SysInfo::NumberOfProcessors()); |
89 } | 90 } |
90 | 91 |
91 // Called on the blocking pool some time after startup to avoid slowing down | 92 // Called on the blocking pool some time after startup to avoid slowing down |
92 // startup with metrics that aren't trivial to compute. | 93 // startup with metrics that aren't trivial to compute. |
93 void RecordStartupMetricsOnBlockingPool() { | 94 void RecordStartupMetricsOnBlockingPool() { |
94 #if defined(OS_WIN) | 95 #if defined(OS_WIN) |
95 GoogleUpdateSettings::RecordChromeUpdatePolicyHistograms(); | 96 GoogleUpdateSettings::RecordChromeUpdatePolicyHistograms(); |
96 #endif // defined(OS_WIN) | 97 #endif // defined(OS_WIN) |
| 98 |
| 99 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 100 bluetooth_utility::BluetoothAvailability availability = |
| 101 bluetooth_utility::GetBluetoothAvailability(); |
| 102 UMA_HISTOGRAM_ENUMERATION("OSX.BluetoothAvailability", |
| 103 availability, |
| 104 bluetooth_utility::BLUETOOTH_AVAILABILITY_COUNT); |
| 105 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
97 } | 106 } |
98 | 107 |
99 void RecordLinuxGlibcVersion() { | 108 void RecordLinuxGlibcVersion() { |
100 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 109 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
101 Version version(gnu_get_libc_version()); | 110 Version version(gnu_get_libc_version()); |
102 | 111 |
103 UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE; | 112 UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE; |
104 if (version.IsValid() && version.components().size() == 2) { | 113 if (version.IsValid() && version.components().size() == 2) { |
105 glibc_version_result = UMA_LINUX_GLIBC_UNKNOWN; | 114 glibc_version_result = UMA_LINUX_GLIBC_UNKNOWN; |
106 int glibc_major_version = version.components()[0]; | 115 int glibc_major_version = version.components()[0]; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 #endif | 240 #endif |
232 } | 241 } |
233 | 242 |
234 namespace chrome { | 243 namespace chrome { |
235 | 244 |
236 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { | 245 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { |
237 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); | 246 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); |
238 } | 247 } |
239 | 248 |
240 } // namespace chrome | 249 } // namespace chrome |
OLD | NEW |