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

Unified Diff: remoting/client/software_video_renderer.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/software_video_renderer.cc
diff --git a/remoting/client/software_video_renderer.cc b/remoting/client/software_video_renderer.cc
index 51782e05f476f4942a30408a7e52d0214cc0a80f..8c8855ddddec660ecc837068bc2e01ce1b904ed7 100644
--- a/remoting/client/software_video_renderer.cc
+++ b/remoting/client/software_video_renderer.cc
@@ -11,6 +11,7 @@
#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
#include "remoting/base/util.h"
#include "remoting/client/frame_consumer.h"
@@ -362,10 +363,18 @@ void SoftwareVideoRenderer::ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
// Record other statistics received from host.
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_event_timestamp_) {
latest_event_timestamp_ = packet->latest_event_timestamp();
@@ -373,6 +382,8 @@ void SoftwareVideoRenderer::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);
}
// Measure the latency between the last packet being received and presented.

Powered by Google App Engine
This is Rietveld 408576698