Commit 917c61c1 authored by bruthig's avatar bruthig Committed by Commit bot

Partial revert of "Added metrics to count the number of items in the shelf."

Collecting the metrics was sometimes causing a crash and has been removed
until the root cause is found.
This is only a partial revert because items are not to be removed from
tools/metrics/histograms/histograms.xml.

BUG=474702

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

Cr-Commit-Position: refs/heads/master@{#324226}
parent 21669c13
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
#include "ash/metrics/user_metrics_recorder.h" #include "ash/metrics/user_metrics_recorder.h"
#include "ash/shelf/shelf_delegate.h"
#include "ash/shelf/shelf_item_types.h"
#include "ash/shelf/shelf_layout_manager.h" #include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_model.h"
#include "ash/shelf/shelf_view.h" #include "ash/shelf/shelf_view.h"
#include "ash/shelf/shelf_widget.h" #include "ash/shelf/shelf_widget.h"
#include "ash/shell.h" #include "ash/shell.h"
...@@ -124,29 +121,6 @@ int GetNumVisibleWindowsInPrimaryDisplay() { ...@@ -124,29 +121,6 @@ int GetNumVisibleWindowsInPrimaryDisplay() {
return visible_window_count; return visible_window_count;
} }
void RecordShelfItemCounts() {
ShelfDelegate* shelf_delegate = Shell::GetInstance()->GetShelfDelegate();
int pinned_item_count = 0;
int unpinned_item_count = 0;
for (const ShelfItem& shelf_item :
Shell::GetInstance()->shelf_model()->items()) {
if (shelf_item.type != TYPE_APP_LIST) {
if (shelf_delegate->IsAppPinned(
shelf_delegate->GetAppIDForShelfID(shelf_item.id)))
++pinned_item_count;
else
++unpinned_item_count;
}
}
UMA_HISTOGRAM_COUNTS_100("Ash.Shelf.NumberOfItems",
pinned_item_count + unpinned_item_count);
UMA_HISTOGRAM_COUNTS_100("Ash.Shelf.NumberOfPinnedItems", pinned_item_count);
UMA_HISTOGRAM_COUNTS_100("Ash.Shelf.NumberOfUnpinnedItems",
unpinned_item_count);
}
} // namespace } // namespace
UserMetricsRecorder::UserMetricsRecorder() { UserMetricsRecorder::UserMetricsRecorder() {
...@@ -561,8 +535,6 @@ void UserMetricsRecorder::RecordPeriodicMetrics() { ...@@ -561,8 +535,6 @@ void UserMetricsRecorder::RecordPeriodicMetrics() {
UMA_HISTOGRAM_ENUMERATION("Ash.ActiveWindowShowTypeOverTime", UMA_HISTOGRAM_ENUMERATION("Ash.ActiveWindowShowTypeOverTime",
GetActiveWindowState(), GetActiveWindowState(),
ACTIVE_WINDOW_STATE_TYPE_COUNT); ACTIVE_WINDOW_STATE_TYPE_COUNT);
RecordShelfItemCounts();
} }
} // namespace ash } // namespace ash
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