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

Unified Diff: media/blink/cdm_result_promise_helper.cc

Issue 2691673002: media: Add UMA to record time to GenerateRequest and LoadSession (Closed)
Patch Set: Created 3 years, 10 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 | « media/blink/cdm_result_promise_helper.h ('k') | media/blink/new_session_cdm_result_promise.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/cdm_result_promise_helper.cc
diff --git a/media/blink/cdm_result_promise_helper.cc b/media/blink/cdm_result_promise_helper.cc
index 6c4f9effaae4363c726b156d27adf7fd2943d4e2..a6ae0311c35501f8af0bbab7e27eb60924c57365 100644
--- a/media/blink/cdm_result_promise_helper.cc
+++ b/media/blink/cdm_result_promise_helper.cc
@@ -70,4 +70,14 @@ void ReportCdmResultUMA(const std::string& uma_name, CdmResultForUMA result) {
base::HistogramBase::kUmaTargetedHistogramFlag)->Add(result);
}
+void ReportTimeUMA(const std::string& uma_name, base::TimeDelta time) {
+ // Note: This leaks memory, which is expected behavior.
+ base::HistogramBase* histogram = base::Histogram::FactoryTimeGet(
+ uma_name, base::TimeDelta::FromMilliseconds(1),
+ base::TimeDelta::FromSeconds(10), 50,
+ base::HistogramBase::kUmaTargetedHistogramFlag);
+
+ histogram->AddTime(time);
Ilya Sherman 2017/02/11 00:50:53 Please use "base::UmaHistogramTimes(name, time);"
xhwang 2017/02/11 01:12:45 Great. Didn't know this existed. PTAL again!
+}
+
} // namespace media
« no previous file with comments | « media/blink/cdm_result_promise_helper.h ('k') | media/blink/new_session_cdm_result_promise.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698