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

Side by Side Diff: media/base/android/media_statistics.cc

Issue 1458783002: Fix UMA metrics for MediaSourcePlayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/android/media_statistics.h" 5 #include "media/base/android/media_statistics.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "media/base/android/demuxer_stream_player_params.h" 9 #include "media/base/android/demuxer_stream_player_params.h"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 if (start_time_ == kNoTimestamp()) { 44 if (start_time_ == kNoTimestamp()) {
45 Clear(); 45 Clear();
46 start_time_ = current_playback_time; 46 start_time_ = current_playback_time;
47 } 47 }
48 } 48 }
49 49
50 void MediaStatistics::StopAndReport(base::TimeDelta current_playback_time) { 50 void MediaStatistics::StopAndReport(base::TimeDelta current_playback_time) {
51 DVLOG(1) << __FUNCTION__; 51 DVLOG(1) << __FUNCTION__;
52 52
53 if (start_time_ == kNoTimestamp()) 53 if (start_time_ == kNoTimestamp() || current_playback_time == kNoTimestamp())
54 return; // skip if there was no prior Start(). 54 return; // skip if there was no prior Start() or current time is wrong.
55 55
56 base::TimeDelta duration = current_playback_time - start_time_; 56 base::TimeDelta duration = current_playback_time - start_time_;
57 57
58 // Reset start time. 58 // Reset start time.
59 start_time_ = kNoTimestamp(); 59 start_time_ = kNoTimestamp();
60 60
61 if (duration < base::TimeDelta::FromSeconds(kMinDurationInSeconds)) 61 if (duration < base::TimeDelta::FromSeconds(kMinDurationInSeconds))
62 return; // duration is too short. 62 return; // duration is too short.
63 63
64 if (duration > base::TimeDelta::FromSeconds(kMaxDurationInSeconds)) 64 if (duration > base::TimeDelta::FromSeconds(kMaxDurationInSeconds))
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 uint32_t total_frames = audio_frame_stats_.total ? audio_frame_stats_.total 111 uint32_t total_frames = audio_frame_stats_.total ? audio_frame_stats_.total
112 : video_frame_stats_.total; 112 : video_frame_stats_.total;
113 if (total_frames) { 113 if (total_frames) {
114 UMA_HISTOGRAM_COUNTS("Media.MSE.Starvations", 114 UMA_HISTOGRAM_COUNTS("Media.MSE.Starvations",
115 kOneMillion * num_starvations_ / total_frames); 115 kOneMillion * num_starvations_ / total_frames);
116 } 116 }
117 } 117 }
118 118
119 } // namespace media 119 } // namespace media
OLDNEW
« media/base/android/media_source_player.cc ('K') | « media/base/android/media_source_player.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698