Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2920)

Unified Diff: ash/wm/overview/scoped_overview_animation_settings_aura.cc

Issue 2631333002: [animations] Adds metrics for jank on selected layer animations (Closed)
Patch Set: Adds UMA reporting for ripples and overview mode (query refresh rate) Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/overview/scoped_overview_animation_settings_aura.cc
diff --git a/ash/wm/overview/scoped_overview_animation_settings_aura.cc b/ash/wm/overview/scoped_overview_animation_settings_aura.cc
index d785c185dfe0f306f3abed9ed5c2c737a11a0cd6..56e7a19e8a933e8c5354279471d405a384021d07 100644
--- a/ash/wm/overview/scoped_overview_animation_settings_aura.cc
+++ b/ash/wm/overview/scoped_overview_animation_settings_aura.cc
@@ -4,6 +4,8 @@
#include "ash/wm/overview/scoped_overview_animation_settings_aura.h"
+#include "base/lazy_instance.h"
+#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
#include "ui/aura/window.h"
#include "ui/compositor/layer.h"
@@ -51,6 +53,53 @@ base::TimeDelta GetAnimationDuration(OverviewAnimationType animation_type) {
return base::TimeDelta();
}
+class OverviewEnterMetricsReporter : public ui::AnimationMetricsReporter {
+ void Report(int value) override {
+ UMA_HISTOGRAM_PERCENTAGE("Ash.WindowSelector.AnimationSmoothness.Enter",
+ value);
+ }
+};
+
+class OverviewExitMetricsReporter : public ui::AnimationMetricsReporter {
+ void Report(int value) override {
+ UMA_HISTOGRAM_PERCENTAGE("Ash.WindowSelector.AnimationSmoothness.Exit",
+ value);
+ }
+};
+
+class OverviewCloseMetricsReporter : public ui::AnimationMetricsReporter {
+ void Report(int value) override {
+ UMA_HISTOGRAM_PERCENTAGE("Ash.WindowSelector.AnimationSmoothness.Close",
+ value);
+ }
+};
+
+base::LazyInstance<OverviewEnterMetricsReporter>::Leaky g_reporter_enter =
+ LAZY_INSTANCE_INITIALIZER;
+base::LazyInstance<OverviewExitMetricsReporter>::Leaky g_reporter_exit =
+ LAZY_INSTANCE_INITIALIZER;
+base::LazyInstance<OverviewCloseMetricsReporter>::Leaky g_reporter_close =
+ LAZY_INSTANCE_INITIALIZER;
+
+ui::AnimationMetricsReporter* GetMetricsReporter(
+ OverviewAnimationType animation_type) {
+ switch (animation_type) {
+ case OVERVIEW_ANIMATION_NONE:
+ return nullptr;
+ case OVERVIEW_ANIMATION_ENTER_OVERVIEW_MODE_FADE_IN:
+ case OVERVIEW_ANIMATION_LAY_OUT_SELECTOR_ITEMS:
+ return g_reporter_enter.Pointer();
+ case OVERVIEW_ANIMATION_EXIT_OVERVIEW_MODE_FADE_OUT:
+ case OVERVIEW_ANIMATION_RESTORE_WINDOW:
+ return g_reporter_exit.Pointer();
+ case OVERVIEW_ANIMATION_CLOSING_SELECTOR_ITEM:
+ case OVERVIEW_ANIMATION_CLOSE_SELECTOR_ITEM:
+ return g_reporter_close.Pointer();
+ }
+ NOTREACHED();
+ return nullptr;
+}
+
} // namespace
ScopedOverviewAnimationSettingsAura::ScopedOverviewAnimationSettingsAura(
@@ -91,6 +140,8 @@ ScopedOverviewAnimationSettingsAura::ScopedOverviewAnimationSettingsAura(
}
animation_settings_->SetTransitionDuration(
GetAnimationDuration(animation_type));
+ animation_settings_->SetAnimationMetricsReporter(
+ GetMetricsReporter(animation_type));
}
ScopedOverviewAnimationSettingsAura::~ScopedOverviewAnimationSettingsAura() {}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698