Commit 35263298 authored by Becca Hughes's avatar Becca Hughes Committed by Commit Bot

Add histogram to measure the time taken to start watching

Adds a histogram that measure the time taken it took from
loading the page to when the user starts watching.

Change-Id: Ifbbcb5ca07c8554e7157ba1b07d3015fb801fe35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2537777
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarWeilun Shi <sweilun@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828901}
parent 54c1a0eb
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <memory> #include <memory>
#include "base/callback.h" #include "base/callback.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "chrome/browser/media/history/media_history_keyed_service.h" #include "chrome/browser/media/history/media_history_keyed_service.h"
#include "chrome/browser/media/history/media_history_keyed_service_factory.h" #include "chrome/browser/media/history/media_history_keyed_service_factory.h"
...@@ -313,6 +314,12 @@ void KaleidoscopeDataProviderImpl::SetSignedOutProviders( ...@@ -313,6 +314,12 @@ void KaleidoscopeDataProviderImpl::SetSignedOutProviders(
kaleidoscope::prefs::kKaleidoscopeSignedOutProviders, *providers_copy); kaleidoscope::prefs::kKaleidoscopeSignedOutProviders, *providers_copy);
} }
void KaleidoscopeDataProviderImpl::RecordTimeTakenToStartWatchHistogram(
base::TimeDelta time) {
base::UmaHistogramMediumTimes("Media.Kaleidoscope.TimeTakenToStartWatch",
time);
}
void KaleidoscopeDataProviderImpl::OnGotCredentialsForCollections( void KaleidoscopeDataProviderImpl::OnGotCredentialsForCollections(
const std::string& request, const std::string& request,
GetCollectionsCallback cb, GetCollectionsCallback cb,
......
...@@ -68,6 +68,7 @@ class KaleidoscopeDataProviderImpl ...@@ -68,6 +68,7 @@ class KaleidoscopeDataProviderImpl
void GetSignedOutProviders(GetSignedOutProvidersCallback cb) override; void GetSignedOutProviders(GetSignedOutProvidersCallback cb) override;
void SetSignedOutProviders( void SetSignedOutProviders(
const std::vector<std::string>& providers) override; const std::vector<std::string>& providers) override;
void RecordTimeTakenToStartWatchHistogram(base::TimeDelta time) override;
private: private:
media_history::MediaHistoryKeyedService* GetMediaHistoryService(); media_history::MediaHistoryKeyedService* GetMediaHistoryService();
......
...@@ -106,6 +106,9 @@ interface KaleidoscopeDataProvider { ...@@ -106,6 +106,9 @@ interface KaleidoscopeDataProvider {
// Stores a list of providers that were chosen by the user. Only used if the // Stores a list of providers that were chosen by the user. Only used if the
// user is signed out. // user is signed out.
SetSignedOutProviders(array<string> providers); SetSignedOutProviders(array<string> providers);
// Records a histogram of the time taken to start a watch action.
RecordTimeTakenToStartWatchHistogram(mojo_base.mojom.TimeDelta time);
}; };
enum GetCollectionsResult { enum GetCollectionsResult {
......
...@@ -2183,6 +2183,17 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -2183,6 +2183,17 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary> </summary>
</histogram> </histogram>
<histogram name="Media.Kaleidoscope.TimeTakenToStartWatch" units="ms"
expires_after="2021-08-19">
<owner>beccahughes@chromium.org</owner>
<owner>media-dev@chromium.org</owner>
<summary>
Recorded the first time in a Kaleidoscope session a user selects a watch
action in Kaleidoscope with the time taken from loading the page to the user
clicking on the watch action.
</summary>
</histogram>
<histogram base="true" name="Media.Learning.BinaryThreshold.Aggregate" <histogram base="true" name="Media.Learning.BinaryThreshold.Aggregate"
enum="ConfusionMatrix" expires_after="2019-10-30"> enum="ConfusionMatrix" expires_after="2019-10-30">
<!-- Name completed by histogram_suffixes <!-- Name completed by histogram_suffixes
......
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