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

Side by Side 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: Note frequency at which UMA stats are being updated/logged. Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "remoting/client/software_video_renderer.h" 5 #include "remoting/client/software_video_renderer.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 } 343 }
344 344
345 protocol::VideoStub* SoftwareVideoRenderer::GetVideoStub() { 345 protocol::VideoStub* SoftwareVideoRenderer::GetVideoStub() {
346 return this; 346 return this;
347 } 347 }
348 348
349 void SoftwareVideoRenderer::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, 349 void SoftwareVideoRenderer::ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
350 const base::Closure& done) { 350 const base::Closure& done) {
351 DCHECK(CalledOnValidThread()); 351 DCHECK(CalledOnValidThread());
352 352
353 stats_.video_packet_rate()->Record(1);
Wez 2015/07/14 20:24:17 See comments in the Pepper 3D renderer re layout &
anandc 2015/07/15 03:59:55 Done.
353 // If the video packet is empty then drop it. Empty packets are used to 354 // If the video packet is empty then drop it. Empty packets are used to
354 // maintain activity on the network. 355 // maintain activity on the network.
355 if (!packet->has_data() || packet->data().size() == 0) { 356 if (!packet->has_data() || packet->data().size() == 0) {
356 done.Run(); 357 done.Run();
Wez 2015/07/14 20:24:17 nit: We should be doing done.Run() here and below
anandc 2015/07/15 03:59:55 Added note to tracking bug.
357 return; 358 return;
358 } 359 }
359 360
360 // Add one frame to the counter. 361 // Add one frame to the video frame rate counters.
Wez 2015/07/14 20:24:17 You're only updating a single counter here, though
anandc 2015/07/15 03:59:55 Done. Holdover from a previous patch-set. Thanks f
361 stats_.video_frame_rate()->Record(1); 362 stats_.video_bandwidth()->Record(1);
Wez 2015/07/14 20:24:17 Looks like you've mistakenly swapped bandwidth & f
anandc 2015/07/15 03:59:55 Aargh, and didn't catch it even with a diff. Thank
362 363
363 // Record other statistics received from host. 364 // Record other statistics received from host.
364 stats_.video_bandwidth()->Record(packet->data().size()); 365 stats_.video_frame_rate()->Record(packet->data().size());
365 if (packet->has_capture_time_ms()) 366 if (packet->has_capture_time_ms())
366 stats_.video_capture_ms()->Record(packet->capture_time_ms()); 367 stats_.video_capture_ms()->Record(packet->capture_time_ms());
367 if (packet->has_encode_time_ms()) 368 if (packet->has_encode_time_ms())
368 stats_.video_encode_ms()->Record(packet->encode_time_ms()); 369 stats_.video_encode_ms()->Record(packet->encode_time_ms());
369 if (packet->has_latest_event_timestamp() && 370 if (packet->has_latest_event_timestamp() &&
370 packet->latest_event_timestamp() > latest_event_timestamp_) { 371 packet->latest_event_timestamp() > latest_event_timestamp_) {
371 latest_event_timestamp_ = packet->latest_event_timestamp(); 372 latest_event_timestamp_ = packet->latest_event_timestamp();
372 base::TimeDelta round_trip_latency = 373 base::TimeDelta round_trip_latency =
373 base::Time::Now() - 374 base::Time::Now() -
374 base::Time::FromInternalValue(packet->latest_event_timestamp()); 375 base::Time::FromInternalValue(packet->latest_event_timestamp());
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 DCHECK(CalledOnValidThread()); 422 DCHECK(CalledOnValidThread());
422 423
423 // Record the latency between the packet being received and presented. 424 // Record the latency between the packet being received and presented.
424 stats_.video_decode_ms()->Record( 425 stats_.video_decode_ms()->Record(
425 (base::Time::Now() - decode_start).InMilliseconds()); 426 (base::Time::Now() - decode_start).InMilliseconds());
426 427
427 done.Run(); 428 done.Run();
428 } 429 }
429 430
430 } // namespace remoting 431 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698