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 /** | 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 if (this.sessionStartTime_ == 0) { | 65 if (this.sessionStartTime_ == 0) { |
66 this.sessionStartTime_ = new Date().getTime(); | 66 this.sessionStartTime_ = new Date().getTime(); |
67 } | 67 } |
68 } | 68 } |
69 // Log the session state change. | 69 // Log the session state change. |
70 var entry = remoting.ServerLogEntry.makeClientSessionStateChange( | 70 var entry = remoting.ServerLogEntry.makeClientSessionStateChange( |
71 state, connectionError, this.mode_); | 71 state, connectionError, this.mode_); |
72 entry.addHostFields(); | 72 entry.addHostFields(); |
73 entry.addChromeVersionField(); | 73 entry.addChromeVersionField(); |
74 entry.addWebappVersionField(); | 74 entry.addWebappVersionField(); |
75 // Log the time taken to get to this state from the time this session started. | |
76 var timeToReachThisState = new Date().getTime() - this.sessionStartTime_; | |
77 entry.addTimeToReachStateMs(timeToReachThisState); | |
Jamie
2015/02/26 20:32:06
This should either be added at a lower level (if y
anandc
2015/02/26 22:47:11
Done. Move further down in this function.
| |
75 entry.addSessionIdField(this.sessionId_); | 78 entry.addSessionIdField(this.sessionId_); |
76 // Maybe clear the session start time, and log the session duration. | 79 // Maybe clear the session start time, and log the session duration. |
77 if (remoting.LogToServer.shouldAddDuration_(state) && | 80 if (remoting.LogToServer.shouldAddDuration_(state) && |
78 (this.sessionStartTime_ != 0)) { | 81 (this.sessionStartTime_ != 0)) { |
79 entry.addSessionDurationField( | 82 entry.addSessionDurationField( |
80 (new Date().getTime() - this.sessionStartTime_) / 1000.0); | 83 (new Date().getTime() - this.sessionStartTime_) / 1000.0); |
81 if (remoting.LogToServer.isEndOfSession_(state)) { | 84 if (remoting.LogToServer.isEndOfSession_(state)) { |
82 this.sessionStartTime_ = 0; | 85 this.sessionStartTime_ = 0; |
83 } | 86 } |
84 } | 87 } |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
270 remoting.LogToServer.generateSessionId_ = function() { | 273 remoting.LogToServer.generateSessionId_ = function() { |
271 var idArray = []; | 274 var idArray = []; |
272 for (var i = 0; i < remoting.LogToServer.SESSION_ID_LEN_; i++) { | 275 for (var i = 0; i < remoting.LogToServer.SESSION_ID_LEN_; i++) { |
273 var index = | 276 var index = |
274 Math.random() * remoting.LogToServer.SESSION_ID_ALPHABET_.length; | 277 Math.random() * remoting.LogToServer.SESSION_ID_ALPHABET_.length; |
275 idArray.push( | 278 idArray.push( |
276 remoting.LogToServer.SESSION_ID_ALPHABET_.slice(index, index + 1)); | 279 remoting.LogToServer.SESSION_ID_ALPHABET_.slice(index, index + 1)); |
277 } | 280 } |
278 return idArray.join(''); | 281 return idArray.join(''); |
279 }; | 282 }; |
OLD | NEW |