Talked with varkha@ on chat.
Currently to use the animation smoothness reporter, we need to define a subclass to override the Report(int value) function.
It would be better if we can avoid this step to make the client side much simpler.
We might have two option here:
1. Have a reporter factory: AnimationMetricsReporter::GetReporter("Ash.Window.AnimationSmoothness.Hide")
This would require initialize a reporter for each animation.
For the lifetime of the reporter, we can create the reporter in an animation observer ctor, and destroy the reporter in the observer dtor. But this would be much harder to do for animations that involve multiple windows and multiple stages such as overview.
2. If can we have a global LAZY animation_metrics_reporter, and Report(const char[] animation_uma_name, int value). Then at the client side, we only need to set the layer_animation_settings_->SetAnimationMetricsReporter(const char[] uma_name).
We can keep all the animation_uma_name in a const file.
Note: varkha@ pointed out second method will not work due to the runtime constant limitation of the histogram object:
https://cs.chromium.org/chromium/src/base/metrics/histogram_macros.h?type=cs&l=23
Comment 1 by ovanieva@chromium.org
, Feb 23 2018