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

Side by Side Diff: remoting/webapp/crd/js/log_to_server.js

Issue 961053004: Rename elapsed-time field in Chromoting log events to session-duration, to align with server-side f… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | remoting/webapp/crd/js/server_log_entry.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * Module for sending log entries to the server. 7 * Module for sending log entries to the server.
8 */ 8 */
9 9
10 'use strict'; 10 'use strict';
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 }; 167 };
168 168
169 /** 169 /**
170 * Sends a log entry to the server. 170 * Sends a log entry to the server.
171 * 171 *
172 * @private 172 * @private
173 * @param {remoting.ServerLogEntry} entry 173 * @param {remoting.ServerLogEntry} entry
174 */ 174 */
175 remoting.LogToServer.prototype.log_ = function(entry) { 175 remoting.LogToServer.prototype.log_ = function(entry) {
176 // Log the time taken to get to this point from the time this session started. 176 // Log the time taken to get to this point from the time this session started.
177 var elapsedTimeInMs = new Date().getTime() - this.sessionStartTime_; 177 var sessionDurationInSeconds =
178 entry.addElapsedTimeMs(elapsedTimeInMs); 178 (new Date().getTime() - this.sessionStartTime_) / 1000.0;
179 entry.addSessionDuration(sessionDurationInSeconds);
179 180
180 // Send the stanza to the debug log. 181 // Send the stanza to the debug log.
181 console.log('Enqueueing log entry:'); 182 console.log('Enqueueing log entry:');
182 entry.toDebugLog(1); 183 entry.toDebugLog(1);
183 184
184 var stanza = '<cli:iq to="' + remoting.settings.DIRECTORY_BOT_JID + '" ' + 185 var stanza = '<cli:iq to="' + remoting.settings.DIRECTORY_BOT_JID + '" ' +
185 'type="set" xmlns:cli="jabber:client">' + 186 'type="set" xmlns:cli="jabber:client">' +
186 '<gr:log xmlns:gr="google:remoting">' + 187 '<gr:log xmlns:gr="google:remoting">' +
187 entry.toStanza() + 188 entry.toStanza() +
188 '</gr:log>' + 189 '</gr:log>' +
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 remoting.LogToServer.generateSessionId_ = function() { 245 remoting.LogToServer.generateSessionId_ = function() {
245 var idArray = []; 246 var idArray = [];
246 for (var i = 0; i < remoting.LogToServer.SESSION_ID_LEN_; i++) { 247 for (var i = 0; i < remoting.LogToServer.SESSION_ID_LEN_; i++) {
247 var index = 248 var index =
248 Math.random() * remoting.LogToServer.SESSION_ID_ALPHABET_.length; 249 Math.random() * remoting.LogToServer.SESSION_ID_ALPHABET_.length;
249 idArray.push( 250 idArray.push(
250 remoting.LogToServer.SESSION_ID_ALPHABET_.slice(index, index + 1)); 251 remoting.LogToServer.SESSION_ID_ALPHABET_.slice(index, index + 1));
251 } 252 }
252 return idArray.join(''); 253 return idArray.join('');
253 }; 254 };
OLDNEW
« no previous file with comments | « no previous file | remoting/webapp/crd/js/server_log_entry.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698