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

Side by Side Diff: remoting/client/server_log_entry_client.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: Set time-window for display stats rate-counters to 3. 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/server_log_entry_client.h" 5 #include "remoting/client/server_log_entry_client.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/stringize_macros.h" 9 #include "base/strings/stringize_macros.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 return entry.Pass(); 108 return entry.Pass();
109 } 109 }
110 110
111 scoped_ptr<ServerLogEntry> MakeLogEntryForStatistics( 111 scoped_ptr<ServerLogEntry> MakeLogEntryForStatistics(
112 ChromotingStats* statistics) { 112 ChromotingStats* statistics) {
113 scoped_ptr<ServerLogEntry> entry(new ServerLogEntry()); 113 scoped_ptr<ServerLogEntry> entry(new ServerLogEntry());
114 entry->AddRoleField(kValueRoleClient); 114 entry->AddRoleField(kValueRoleClient);
115 entry->AddEventNameField(kValueEventNameStatistics); 115 entry->AddEventNameField(kValueEventNameStatistics);
116 116
117 entry->Set("video-bandwidth", 117 entry->Set("video-bandwidth",
118 StringPrintf("%.2f", statistics->video_bandwidth()->Rate())); 118 StringPrintf("%.2f",
119 statistics->video_bandwidth_display()->Rate()));
119 entry->Set("capture-latency", 120 entry->Set("capture-latency",
120 StringPrintf("%.2f", statistics->video_capture_ms()->Average())); 121 StringPrintf("%.2f", statistics->video_capture_ms()->Average()));
121 entry->Set("encode-latency", 122 entry->Set("encode-latency",
122 StringPrintf("%.2f", statistics->video_encode_ms()->Average())); 123 StringPrintf("%.2f", statistics->video_encode_ms()->Average()));
123 entry->Set("decode-latency", 124 entry->Set("decode-latency",
124 StringPrintf("%.2f", statistics->video_decode_ms()->Average())); 125 StringPrintf("%.2f", statistics->video_decode_ms()->Average()));
125 entry->Set("render-latency", 126 entry->Set("render-latency",
126 StringPrintf("%.2f", statistics->video_frame_rate()->Rate())); 127 StringPrintf("%.2f",
128 statistics->video_frame_rate_display()->Rate()));
127 entry->Set("roundtrip-latency", 129 entry->Set("roundtrip-latency",
128 StringPrintf("%.2f", statistics->round_trip_ms()->Average())); 130 StringPrintf("%.2f", statistics->round_trip_ms()->Average()));
129 131
130 return entry.Pass(); 132 return entry.Pass();
131 } 133 }
132 134
133 scoped_ptr<ServerLogEntry> MakeLogEntryForSessionIdOld( 135 scoped_ptr<ServerLogEntry> MakeLogEntryForSessionIdOld(
134 const std::string& session_id) { 136 const std::string& session_id) {
135 scoped_ptr<ServerLogEntry> entry(new ServerLogEntry()); 137 scoped_ptr<ServerLogEntry> entry(new ServerLogEntry());
136 entry->AddRoleField(kValueRoleClient); 138 entry->AddRoleField(kValueRoleClient);
(...skipping 21 matching lines...) Expand all
158 void AddSessionIdToLogEntry(ServerLogEntry* entry, const std::string& id) { 160 void AddSessionIdToLogEntry(ServerLogEntry* entry, const std::string& id) {
159 entry->Set(kKeySessionId, id); 161 entry->Set(kKeySessionId, id);
160 } 162 }
161 163
162 void AddSessionDurationToLogEntry(ServerLogEntry* entry, 164 void AddSessionDurationToLogEntry(ServerLogEntry* entry,
163 base::TimeDelta duration) { 165 base::TimeDelta duration) {
164 entry->Set(kKeySessionDuration, base::Int64ToString(duration.InSeconds())); 166 entry->Set(kKeySessionDuration, base::Int64ToString(duration.InSeconds()));
165 } 167 }
166 168
167 } // namespace remoting 169 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698