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

Unified Diff: remoting/client/plugin/pepper_video_renderer_3d.cc

Issue 1181743005: Report video and network stats averaged over 1s, and create corresponding UMA metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update stats for software-renderer as well. Created 5 years, 6 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
Index: remoting/client/plugin/pepper_video_renderer_3d.cc
diff --git a/remoting/client/plugin/pepper_video_renderer_3d.cc b/remoting/client/plugin/pepper_video_renderer_3d.cc
index 711c2104b702cf083f78a4b4b337286fb20eb91e..3207c4d85c117f7d3b606c37f1a63c0448b332a4 100644
--- a/remoting/client/plugin/pepper_video_renderer_3d.cc
+++ b/remoting/client/plugin/pepper_video_renderer_3d.cc
@@ -7,6 +7,7 @@
#include <math.h>
#include "base/callback_helpers.h"
+#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "ppapi/c/pp_codecs.h"
#include "ppapi/c/ppb_opengles2.h"
@@ -194,13 +195,21 @@ void PepperVideoRenderer3D::ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
if (!packet->data().size())
Sergey Ulanov 2015/06/19 23:08:42 When a frame is empty it's currently not counted f
anandc 2015/06/20 01:31:32 Done.
return;
- // Update statistics.
+ // Update statistics and UMA histograms.
stats_.video_frame_rate()->Record(1);
stats_.video_bandwidth()->Record(packet->data().size());
- if (packet->has_capture_time_ms())
+ if (packet->has_capture_time_ms()) {
stats_.video_capture_ms()->Record(packet->capture_time_ms());
- if (packet->has_encode_time_ms())
+ const base::TimeDelta capture_time =
+ base::TimeDelta::FromInternalValue(packet->capture_time_ms());
+ UMA_HISTOGRAM_TIMES("Chromoting.Video.CaptureLatency", capture_time);
+ }
+ if (packet->has_encode_time_ms()) {
stats_.video_encode_ms()->Record(packet->encode_time_ms());
+ const base::TimeDelta encode_time =
+ base::TimeDelta::FromInternalValue(packet->encode_time_ms());
+ UMA_HISTOGRAM_TIMES("Chromoting.Video.EncodeLatency", encode_time);
+ }
if (packet->has_latest_event_timestamp() &&
packet->latest_event_timestamp() > latest_input_event_timestamp_) {
latest_input_event_timestamp_ = packet->latest_event_timestamp();
@@ -208,6 +217,8 @@ void PepperVideoRenderer3D::ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
base::Time::Now() -
base::Time::FromInternalValue(packet->latest_event_timestamp());
stats_.round_trip_ms()->Record(round_trip_latency.InMilliseconds());
+ UMA_HISTOGRAM_TIMES("Chromoting.Video.RoundTripLatency",
+ round_trip_latency);
}
bool resolution_changed = false;

Powered by Google App Engine
This is Rietveld 408576698