Commit 4695e1ff authored by pkotwicz@chromium.org's avatar pkotwicz@chromium.org

Add UMA stat to track usage of Chrome for Linux across different window managers.

Knowing which window managers Chrome is most often used on will help in testing in new feature development.

BUG=372580
TEST=None

Review URL: https://codereview.chromium.org/330493002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276593 0039d316-1c4b-4281-b951-d872f2087c98
parent 0ac47655
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <gnu/libc-version.h> #include <gnu/libc-version.h>
#include "base/version.h" #include "base/version.h"
#include "ui/base/x/x11_util.h"
#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS)
#if defined(OS_WIN) #if defined(OS_WIN)
...@@ -43,17 +44,36 @@ enum UMALinuxGlibcVersion { ...@@ -43,17 +44,36 @@ enum UMALinuxGlibcVersion {
UMA_LINUX_GLIBC_2_11, UMA_LINUX_GLIBC_2_11,
UMA_LINUX_GLIBC_2_19 = UMA_LINUX_GLIBC_2_11 + 8, UMA_LINUX_GLIBC_2_19 = UMA_LINUX_GLIBC_2_11 + 8,
// NOTE: Add new version above this line and update the enum list in // NOTE: Add new version above this line and update the enum list in
// tools/histograms/histograms.xml accordingly. // tools/metrics/histograms/histograms.xml accordingly.
UMA_LINUX_GLIBC_VERSION_COUNT UMA_LINUX_GLIBC_VERSION_COUNT
}; };
enum UMALinuxWindowManager {
UMA_LINUX_WINDOW_MANAGER_OTHER,
UMA_LINUX_WINDOW_MANAGER_BLACKBOX,
UMA_LINUX_WINDOW_MANAGER_CHROME_OS,
UMA_LINUX_WINDOW_MANAGER_COMPIZ,
UMA_LINUX_WINDOW_MANAGER_ENLIGHTENMENT,
UMA_LINUX_WINDOW_MANAGER_ICE_WM,
UMA_LINUX_WINDOW_MANAGER_KWIN,
UMA_LINUX_WINDOW_MANAGER_METACITY,
UMA_LINUX_WINDOW_MANAGER_MUFFIN,
UMA_LINUX_WINDOW_MANAGER_MUTTER,
UMA_LINUX_WINDOW_MANAGER_OPENBOX,
UMA_LINUX_WINDOW_MANAGER_XFWM4,
// NOTE: Add new window managers above this line and update the enum list in
// tools/metrics/histograms/histograms.xml accordingly.
UMA_LINUX_WINDOW_MANAGER_COUNT
};
enum UMATouchEventsState { enum UMATouchEventsState {
UMA_TOUCH_EVENTS_ENABLED, UMA_TOUCH_EVENTS_ENABLED,
UMA_TOUCH_EVENTS_AUTO_ENABLED, UMA_TOUCH_EVENTS_AUTO_ENABLED,
UMA_TOUCH_EVENTS_AUTO_DISABLED, UMA_TOUCH_EVENTS_AUTO_DISABLED,
UMA_TOUCH_EVENTS_DISABLED, UMA_TOUCH_EVENTS_DISABLED,
// NOTE: Add states only immediately above this line. Make sure to // NOTE: Add states only immediately above this line. Make sure to
// update the enum list in tools/histograms/histograms.xml accordingly. // update the enum list in tools/metrics/histograms/histograms.xml
// accordingly.
UMA_TOUCH_EVENTS_STATE_COUNT UMA_TOUCH_EVENTS_STATE_COUNT
}; };
...@@ -103,6 +123,53 @@ void RecordLinuxGlibcVersion() { ...@@ -103,6 +123,53 @@ void RecordLinuxGlibcVersion() {
#endif #endif
} }
void RecordLinuxWindowManager() {
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
ui::WindowManagerName name = ui::GuessWindowManager();
UMALinuxWindowManager uma_name = UMA_LINUX_WINDOW_MANAGER_OTHER;
switch (name) {
case ui::WM_UNKNOWN:
uma_name = UMA_LINUX_WINDOW_MANAGER_OTHER;
break;
case ui::WM_BLACKBOX:
uma_name = UMA_LINUX_WINDOW_MANAGER_BLACKBOX;
break;
case ui::WM_CHROME_OS:
uma_name = UMA_LINUX_WINDOW_MANAGER_CHROME_OS;
break;
case ui::WM_COMPIZ:
uma_name = UMA_LINUX_WINDOW_MANAGER_COMPIZ;
break;
case ui::WM_ENLIGHTENMENT:
uma_name = UMA_LINUX_WINDOW_MANAGER_ENLIGHTENMENT;
break;
case ui::WM_ICE_WM:
uma_name = UMA_LINUX_WINDOW_MANAGER_ICE_WM;
break;
case ui::WM_KWIN:
uma_name = UMA_LINUX_WINDOW_MANAGER_KWIN;
break;
case ui::WM_METACITY:
uma_name = UMA_LINUX_WINDOW_MANAGER_METACITY;
break;
case ui::WM_MUFFIN:
uma_name = UMA_LINUX_WINDOW_MANAGER_MUFFIN;
break;
case ui::WM_MUTTER:
uma_name = UMA_LINUX_WINDOW_MANAGER_MUTTER;
break;
case ui::WM_OPENBOX:
uma_name = UMA_LINUX_WINDOW_MANAGER_OPENBOX;
break;
case ui::WM_XFWM4:
uma_name = UMA_LINUX_WINDOW_MANAGER_XFWM4;
break;
}
UMA_HISTOGRAM_ENUMERATION("Linux.WindowManager", uma_name,
UMA_LINUX_WINDOW_MANAGER_COUNT);
#endif
}
void RecordTouchEventState() { void RecordTouchEventState() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); const CommandLine& command_line = *CommandLine::ForCurrentProcess();
const std::string touch_enabled_switch = const std::string touch_enabled_switch =
...@@ -148,6 +215,7 @@ void ChromeBrowserMainExtraPartsMetrics::PreBrowserStart() { ...@@ -148,6 +215,7 @@ void ChromeBrowserMainExtraPartsMetrics::PreBrowserStart() {
void ChromeBrowserMainExtraPartsMetrics::PostBrowserStart() { void ChromeBrowserMainExtraPartsMetrics::PostBrowserStart() {
RecordLinuxGlibcVersion(); RecordLinuxGlibcVersion();
RecordLinuxWindowManager();
RecordTouchEventState(); RecordTouchEventState();
const int kStartupMetricsGatheringDelaySeconds = 45; const int kStartupMetricsGatheringDelaySeconds = 45;
......
...@@ -9344,6 +9344,11 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -9344,6 +9344,11 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<summary>The version of glibc used. (Linux only)</summary> <summary>The version of glibc used. (Linux only)</summary>
</histogram> </histogram>
<histogram name="Linux.WindowManager" enum="LinuxWindowManagerName">
<owner>pkotwicz@chromium.org</owner>
<summary>The window manager used. (Linux only) Logged at startup.</summary>
</histogram>
<histogram name="LocalDiscovery.ClientRestartAttempts"> <histogram name="LocalDiscovery.ClientRestartAttempts">
<owner>noamsml@chromium.org</owner> <owner>noamsml@chromium.org</owner>
<owner>vitalybuka@chromium.org</owner> <owner>vitalybuka@chromium.org</owner>
...@@ -38619,6 +38624,21 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -38619,6 +38624,21 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<int value="10" label="2.19"/> <int value="10" label="2.19"/>
</enum> </enum>
<enum name="LinuxWindowManagerName" type="int">
<int value="0" label="Other"/>
<int value="1" label="Blackbox"/>
<int value="2" label="Chrome OS"/>
<int value="3" label="Compiz"/>
<int value="4" label="Enlightment"/>
<int value="5" label="IceWM"/>
<int value="6" label="KWin"/>
<int value="7" label="Metacity"/>
<int value="8" label="Muffin"/>
<int value="9" label="Mutter"/>
<int value="10" label="Openbox"/>
<int value="11" label="Xfwm4"/>
</enum>
<enum name="LoadType" type="int"> <enum name="LoadType" type="int">
<int value="0" label="UNDEFINED_LOAD">Not yet initialized</int> <int value="0" label="UNDEFINED_LOAD">Not yet initialized</int>
<int value="1" label="RELOAD">User pressed reload</int> <int value="1" label="RELOAD">User pressed reload</int>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment