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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2568303002: Report WMPI components memory usage to UMA (Closed)
Patch Set: nits Created 4 years 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: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index a105327d0635b16c4d2fdc937a2cb7a89c32fa91..7d69e105c5fa7e415ed1bf35bc42d95deb6f350b 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -1932,22 +1932,40 @@ void WebMediaPlayerImpl::FinishMemoryUsageReport(int64_t demuxer_memory_usage) {
DCHECK(main_task_runner_->BelongsToCurrentThread());
const PipelineStatistics stats = pipeline_.GetStatistics();
+ const int64_t data_source_memory_usage =
+ data_source_ ? data_source_->GetMemoryUsage() : 0;
const int64_t current_memory_usage =
stats.audio_memory_usage + stats.video_memory_usage +
- (data_source_ ? data_source_->GetMemoryUsage() : 0) +
- demuxer_memory_usage;
+ data_source_memory_usage + demuxer_memory_usage;
// Note, this isn't entirely accurate, there may be VideoFrames held by the
// compositor or other resources that we're unaware of.
DVLOG(2) << "Memory Usage -- Audio: " << stats.audio_memory_usage
- << ", Video: " << stats.video_memory_usage << ", DataSource: "
- << (data_source_ ? data_source_->GetMemoryUsage() : 0)
+ << ", Video: " << stats.video_memory_usage
+ << ", DataSource: " << data_source_memory_usage
<< ", Demuxer: " << demuxer_memory_usage;
const int64_t delta = current_memory_usage - last_reported_memory_usage_;
last_reported_memory_usage_ = current_memory_usage;
adjust_allocated_memory_cb_.Run(delta);
+
+ if (hasAudio()) {
+ UMA_HISTOGRAM_MEMORY_KB("Media.WebMediaPlayerImpl.Memory.Audio",
+ stats.audio_memory_usage / 1024);
+ }
+ if (hasVideo()) {
+ UMA_HISTOGRAM_MEMORY_KB("Media.WebMediaPlayerImpl.Memory.Video",
+ stats.video_memory_usage / 1024);
+ }
+ if (data_source_) {
+ UMA_HISTOGRAM_MEMORY_KB("Media.WebMediaPlayerImpl.Memory.DataSource",
+ data_source_memory_usage / 1024);
+ }
+ if (demuxer_) {
+ UMA_HISTOGRAM_MEMORY_KB("Media.WebMediaPlayerImpl.Memory.Demuxer",
+ demuxer_memory_usage / 1024);
+ }
}
void WebMediaPlayerImpl::ScheduleIdlePauseTimer() {
« 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