Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <nacl_io/nacl_io.h> | 7 #include <nacl_io/nacl_io.h> |
| 8 #include <sys/mount.h> | 8 #include <sys/mount.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1027 data->SetString("iq", iq); | 1027 data->SetString("iq", iq); |
| 1028 PostLegacyJsonMessage("sendOutgoingIq", std::move(data)); | 1028 PostLegacyJsonMessage("sendOutgoingIq", std::move(data)); |
| 1029 } | 1029 } |
| 1030 | 1030 |
| 1031 void ChromotingInstance::UpdatePerfStatsInUI() { | 1031 void ChromotingInstance::UpdatePerfStatsInUI() { |
| 1032 // Fetch performance stats from the VideoRenderer and send them to the client | 1032 // Fetch performance stats from the VideoRenderer and send them to the client |
| 1033 // for display to users. | 1033 // for display to users. |
| 1034 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 1034 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 1035 data->SetDouble("videoBandwidth", perf_tracker_.video_bandwidth()); | 1035 data->SetDouble("videoBandwidth", perf_tracker_.video_bandwidth()); |
| 1036 data->SetDouble("videoFrameRate", perf_tracker_.video_frame_rate()); | 1036 data->SetDouble("videoFrameRate", perf_tracker_.video_frame_rate()); |
| 1037 data->SetDouble("captureLatency", perf_tracker_.video_capture_ms()); | 1037 data->SetDouble("captureLatency", perf_tracker_.video_capture_ms().Average()); |
| 1038 data->SetDouble("encodeLatency", perf_tracker_.video_encode_ms()); | 1038 data->SetDouble("encodeLatency", perf_tracker_.video_encode_ms().Average()); |
| 1039 data->SetDouble("decodeLatency", perf_tracker_.video_decode_ms()); | 1039 data->SetDouble("decodeLatency", perf_tracker_.video_decode_ms().Average()); |
| 1040 data->SetDouble("renderLatency", perf_tracker_.video_paint_ms()); | 1040 data->SetDouble("renderLatency", perf_tracker_.video_paint_ms().Average()); |
| 1041 data->SetDouble("roundtripLatency", perf_tracker_.round_trip_ms()); | 1041 data->SetDouble("roundtripLatency", perf_tracker_.round_trip_ms().Average()); |
| 1042 data->SetDouble("maxCaptureLatency", perf_tracker_.video_capture_ms().Max()); | |
|
Sergey Ulanov
2016/03/21 19:35:06
maybe reorder these so max is always after average
Yuwei
2016/03/21 19:59:40
Sure. Then duplicating lines will be easier
| |
| 1043 data->SetDouble("maxEncodeLatency", perf_tracker_.video_encode_ms().Max()); | |
| 1044 data->SetDouble("maxDecodeLatency", perf_tracker_.video_decode_ms().Max()); | |
| 1045 data->SetDouble("maxRenderLatency", perf_tracker_.video_paint_ms().Max()); | |
| 1046 data->SetDouble("maxRoundtripLatency", perf_tracker_.round_trip_ms().Max()); | |
| 1042 PostLegacyJsonMessage("onPerfStats", std::move(data)); | 1047 PostLegacyJsonMessage("onPerfStats", std::move(data)); |
| 1043 } | 1048 } |
| 1044 | 1049 |
| 1045 // static | 1050 // static |
| 1046 void ChromotingInstance::RegisterLogMessageHandler() { | 1051 void ChromotingInstance::RegisterLogMessageHandler() { |
| 1047 base::AutoLock lock(g_logging_lock.Get()); | 1052 base::AutoLock lock(g_logging_lock.Get()); |
| 1048 | 1053 |
| 1049 // Set up log message handler. | 1054 // Set up log message handler. |
| 1050 // This is not thread-safe so we need it within our lock. | 1055 // This is not thread-safe so we need it within our lock. |
| 1051 logging::SetLogMessageHandler(&LogToUI); | 1056 logging::SetLogMessageHandler(&LogToUI); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1132 if (is_custom_counts_histogram) { | 1137 if (is_custom_counts_histogram) { |
| 1133 uma.HistogramCustomCounts(histogram_name, value, histogram_min, | 1138 uma.HistogramCustomCounts(histogram_name, value, histogram_min, |
| 1134 histogram_max, histogram_buckets); | 1139 histogram_max, histogram_buckets); |
| 1135 } else { | 1140 } else { |
| 1136 uma.HistogramCustomTimes(histogram_name, value, histogram_min, | 1141 uma.HistogramCustomTimes(histogram_name, value, histogram_min, |
| 1137 histogram_max, histogram_buckets); | 1142 histogram_max, histogram_buckets); |
| 1138 } | 1143 } |
| 1139 } | 1144 } |
| 1140 | 1145 |
| 1141 } // namespace remoting | 1146 } // namespace remoting |
| OLD | NEW |