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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * A class of server log entries. | 7 * A class of server log entries. |
| 8 * | 8 * |
| 9 * Any changes to the values here need to be coordinated with the host and | 9 * Any changes to the values here need to be coordinated with the host and |
| 10 * server/log proto code. | 10 * server/log proto code. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 /** @private */ | 42 /** @private */ |
| 43 remoting.ServerLogEntry.KEY_CONNECTION_TYPE_ = 'connection-type'; | 43 remoting.ServerLogEntry.KEY_CONNECTION_TYPE_ = 'connection-type'; |
| 44 /** @private */ | 44 /** @private */ |
| 45 remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_TYPE_ = 'signal-strategy-type'; | 45 remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_TYPE_ = 'signal-strategy-type'; |
| 46 /** @private */ | 46 /** @private */ |
| 47 remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_PROGRESS_ = | 47 remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_PROGRESS_ = |
| 48 'signal-strategy-progress'; | 48 'signal-strategy-progress'; |
| 49 /** @private */ | 49 /** @private */ |
| 50 remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_ELAPSED_TIME_ = | 50 remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_ELAPSED_TIME_ = |
| 51 'signal-strategy-elapsed-time'; | 51 'signal-strategy-elapsed-time'; |
| 52 /** @private */ | |
| 53 remoting.ServerLogEntry.VALUE_EVENT_NAME_TOTAL_TIME_FOR_INITIAL_CONNECT_ = | |
|
Sriram
2015/02/25 19:50:44
This is little confusing as why there is value of
anandc
2015/02/25 20:27:55
Done.
| |
| 54 'total-time-for-initial-connect'; | |
| 55 /** @private */ | |
| 56 remoting.ServerLogEntry.KEY_TOTAL_TIME_FOR_INITIAL_CONNECT_ = | |
|
Sriram
2015/02/25 19:50:44
Include the unit for time in the name.
anandc
2015/02/25 20:27:55
Done.
| |
| 57 'total-time-for-initial-connect'; | |
| 58 | |
| 59 | |
| 52 | 60 |
| 53 /** | 61 /** |
| 54 * @private | 62 * @private |
| 55 * @param {remoting.ClientSession.State} state | 63 * @param {remoting.ClientSession.State} state |
| 56 * @return {string} | 64 * @return {string} |
| 57 */ | 65 */ |
| 58 remoting.ServerLogEntry.getValueForSessionState_ = function(state) { | 66 remoting.ServerLogEntry.getValueForSessionState_ = function(state) { |
| 59 switch(state) { | 67 switch(state) { |
| 60 case remoting.ClientSession.State.UNKNOWN: | 68 case remoting.ClientSession.State.UNKNOWN: |
| 61 return 'unknown'; | 69 return 'unknown'; |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 * @param {remoting.StatsAccumulator} statsAccumulator | 316 * @param {remoting.StatsAccumulator} statsAccumulator |
| 309 * @return {boolean} whether the statistic is non-zero | 317 * @return {boolean} whether the statistic is non-zero |
| 310 */ | 318 */ |
| 311 remoting.ServerLogEntry.prototype.addStatsField_ = function( | 319 remoting.ServerLogEntry.prototype.addStatsField_ = function( |
| 312 entryKey, statsKey, statsAccumulator) { | 320 entryKey, statsKey, statsAccumulator) { |
| 313 var val = statsAccumulator.calcMean(statsKey); | 321 var val = statsAccumulator.calcMean(statsKey); |
| 314 this.set_(entryKey, val.toFixed(2)); | 322 this.set_(entryKey, val.toFixed(2)); |
| 315 return (val != 0); | 323 return (val != 0); |
| 316 }; | 324 }; |
| 317 | 325 |
| 326 | |
| 327 /** | |
| 328 * Makes a log entry for a "total connection time" event. | |
| 329 * | |
| 330 * @param {string} sessionId | |
| 331 * @param {remoting.DesktopConnectedView.Mode} mode | |
| 332 * @param {number} connectionTimeInMs | |
| 333 * @return {remoting.ServerLogEntry} | |
| 334 */ | |
| 335 remoting.ServerLogEntry.makeTotalTimeForInitialConnection = | |
| 336 function(sessionId, mode, connectionTimeInMs) { | |
| 337 var entry = new remoting.ServerLogEntry(); | |
| 338 entry.set_(remoting.ServerLogEntry.KEY_ROLE_, | |
| 339 remoting.ServerLogEntry.VALUE_ROLE_CLIENT_); | |
| 340 entry.set_( | |
| 341 remoting.ServerLogEntry.KEY_EVENT_NAME_, | |
| 342 remoting.ServerLogEntry.VALUE_EVENT_NAME_TOTAL_TIME_FOR_INITIAL_CONNECT_); | |
| 343 entry.set_(remoting.ServerLogEntry.KEY_TOTAL_TIME_FOR_INITIAL_CONNECT_, | |
| 344 String(connectionTimeInMs)); | |
| 345 entry.addSessionIdField(sessionId); | |
| 346 entry.addModeField(mode); | |
| 347 return entry; | |
| 348 }; | |
| 349 | |
| 350 | |
| 318 /** | 351 /** |
| 319 * Makes a log entry for a "this session ID is old" event. | 352 * Makes a log entry for a "this session ID is old" event. |
| 320 * | 353 * |
| 321 * @param {string} sessionId | 354 * @param {string} sessionId |
| 322 * @param {remoting.DesktopConnectedView.Mode} mode | 355 * @param {remoting.DesktopConnectedView.Mode} mode |
| 323 * @return {remoting.ServerLogEntry} | 356 * @return {remoting.ServerLogEntry} |
| 324 */ | 357 */ |
| 325 remoting.ServerLogEntry.makeSessionIdOld = function(sessionId, mode) { | 358 remoting.ServerLogEntry.makeSessionIdOld = function(sessionId, mode) { |
| 326 var entry = new remoting.ServerLogEntry(); | 359 var entry = new remoting.ServerLogEntry(); |
| 327 entry.set_(remoting.ServerLogEntry.KEY_ROLE_, | 360 entry.set_(remoting.ServerLogEntry.KEY_ROLE_, |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 508 case remoting.DesktopConnectedView.Mode.IT2ME: | 541 case remoting.DesktopConnectedView.Mode.IT2ME: |
| 509 return remoting.ServerLogEntry.VALUE_MODE_IT2ME_; | 542 return remoting.ServerLogEntry.VALUE_MODE_IT2ME_; |
| 510 case remoting.DesktopConnectedView.Mode.ME2ME: | 543 case remoting.DesktopConnectedView.Mode.ME2ME: |
| 511 return remoting.ServerLogEntry.VALUE_MODE_ME2ME_; | 544 return remoting.ServerLogEntry.VALUE_MODE_ME2ME_; |
| 512 case remoting.DesktopConnectedView.Mode.APP_REMOTING: | 545 case remoting.DesktopConnectedView.Mode.APP_REMOTING: |
| 513 return remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_; | 546 return remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_; |
| 514 default: | 547 default: |
| 515 return remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_; | 548 return remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_; |
| 516 } | 549 } |
| 517 }; | 550 }; |
| OLD | NEW |