Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Merge Partial revert of "Added metrics to count the number of items i…
Browse files Browse the repository at this point in the history
…n the shelf."

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.

[email protected]
NOTRY=true
NOPRESUBMIT=true
BUG=474702

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

Cr-Commit-Position: refs/heads/master@{#324226}
(cherry picked from commit 917c61c)

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

Cr-Commit-Position: refs/branch-heads/2357@{#32}
Cr-Branched-From: 59d4494-refs/heads/master@{#323860}
  • Loading branch information
jonross authored and Commit bot committed Apr 9, 2015
1 parent b2049a6 commit f7e78a8
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions ash/metrics/user_metrics_recorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

#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_model.h"
#include "ash/shelf/shelf_view.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
Expand Down Expand Up @@ -124,29 +121,6 @@ int GetNumVisibleWindowsInPrimaryDisplay() {
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

UserMetricsRecorder::UserMetricsRecorder() {
Expand Down Expand Up @@ -561,8 +535,6 @@ void UserMetricsRecorder::RecordPeriodicMetrics() {
UMA_HISTOGRAM_ENUMERATION("Ash.ActiveWindowShowTypeOverTime",
GetActiveWindowState(),
ACTIVE_WINDOW_STATE_TYPE_COUNT);

RecordShelfItemCounts();
}

} // namespace ash

0 comments on commit f7e78a8

Please sign in to comment.