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

Side by Side Diff: remoting/client/plugin/chromoting_instance.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/plugin/chromoting_instance.h" 5 #include "remoting/client/plugin/chromoting_instance.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #if defined(OS_NACL) 10 #if defined(OS_NACL)
11 #include <nacl_io/nacl_io.h> 11 #include <nacl_io/nacl_io.h>
12 #include <sys/mount.h> 12 #include <sys/mount.h>
13 #endif 13 #endif
14 14
15 #include "base/bind.h" 15 #include "base/bind.h"
16 #include "base/callback.h" 16 #include "base/callback.h"
17 #include "base/callback_helpers.h" 17 #include "base/callback_helpers.h"
18 #include "base/json/json_reader.h" 18 #include "base/json/json_reader.h"
19 #include "base/json/json_writer.h" 19 #include "base/json/json_writer.h"
20 #include "base/lazy_instance.h" 20 #include "base/lazy_instance.h"
21 #include "base/logging.h" 21 #include "base/logging.h"
22 #include "base/metrics/histogram_macros.h"
22 #include "base/strings/string_split.h" 23 #include "base/strings/string_split.h"
23 #include "base/strings/stringprintf.h" 24 #include "base/strings/stringprintf.h"
24 #include "base/synchronization/lock.h" 25 #include "base/synchronization/lock.h"
25 #include "base/threading/thread.h" 26 #include "base/threading/thread.h"
26 #include "base/values.h" 27 #include "base/values.h"
27 #include "crypto/random.h" 28 #include "crypto/random.h"
28 #include "jingle/glue/thread_wrapper.h" 29 #include "jingle/glue/thread_wrapper.h"
29 #include "media/base/yuv_convert.h" 30 #include "media/base/yuv_convert.h"
30 #include "net/socket/ssl_server_socket.h" 31 #include "net/socket/ssl_server_socket.h"
31 #include "ppapi/cpp/completion_callback.h" 32 #include "ppapi/cpp/completion_callback.h"
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 1058 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
1058 ChromotingStats* stats = video_renderer_->GetStats(); 1059 ChromotingStats* stats = video_renderer_->GetStats();
1059 data->SetDouble("videoBandwidth", stats->video_bandwidth()->Rate()); 1060 data->SetDouble("videoBandwidth", stats->video_bandwidth()->Rate());
1060 data->SetDouble("videoFrameRate", stats->video_frame_rate()->Rate()); 1061 data->SetDouble("videoFrameRate", stats->video_frame_rate()->Rate());
1061 data->SetDouble("captureLatency", stats->video_capture_ms()->Average()); 1062 data->SetDouble("captureLatency", stats->video_capture_ms()->Average());
1062 data->SetDouble("encodeLatency", stats->video_encode_ms()->Average()); 1063 data->SetDouble("encodeLatency", stats->video_encode_ms()->Average());
1063 data->SetDouble("decodeLatency", stats->video_decode_ms()->Average()); 1064 data->SetDouble("decodeLatency", stats->video_decode_ms()->Average());
1064 data->SetDouble("renderLatency", stats->video_paint_ms()->Average()); 1065 data->SetDouble("renderLatency", stats->video_paint_ms()->Average());
1065 data->SetDouble("roundtripLatency", stats->round_trip_ms()->Average()); 1066 data->SetDouble("roundtripLatency", stats->round_trip_ms()->Average());
1066 PostLegacyJsonMessage("onPerfStats", data.Pass()); 1067 PostLegacyJsonMessage("onPerfStats", data.Pass());
1068 // Also update UMA histograms for video frame-rate and bandwidth.
1069 UMA_HISTOGRAM_COUNTS("Chromoting.Video.FrameRate",
1070 stats->video_frame_rate()->Rate());
1071 UMA_HISTOGRAM_COUNTS("Chromoting.Video.Bandwidth",
1072 stats->video_bandwidth()->Rate());
1067 } 1073 }
1068 1074
1069 // static 1075 // static
1070 void ChromotingInstance::RegisterLogMessageHandler() { 1076 void ChromotingInstance::RegisterLogMessageHandler() {
1071 base::AutoLock lock(g_logging_lock.Get()); 1077 base::AutoLock lock(g_logging_lock.Get());
1072 1078
1073 VLOG(1) << "Registering global log handler"; 1079 VLOG(1) << "Registering global log handler";
1074 1080
1075 // Record previous handler so we can call it in a chain. 1081 // Record previous handler so we can call it in a chain.
1076 g_logging_old_handler = logging::GetLogMessageHandler(); 1082 g_logging_old_handler = logging::GetLogMessageHandler();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 1202
1197 #if !defined(OS_NACL) 1203 #if !defined(OS_NACL)
1198 // Log messages are forwarded to the webapp only in PNaCl version of the 1204 // Log messages are forwarded to the webapp only in PNaCl version of the
1199 // plugin, so ProcessLogToUI() needs to be called explicitly in the non-PNaCl 1205 // plugin, so ProcessLogToUI() needs to be called explicitly in the non-PNaCl
1200 // version. 1206 // version.
1201 ProcessLogToUI(message); 1207 ProcessLogToUI(message);
1202 #endif // !defined(OS_NACL) 1208 #endif // !defined(OS_NACL)
1203 } 1209 }
1204 1210
1205 } // namespace remoting 1211 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698