Introduce reporting constants - Timing
* Goal is to have a limited number of constants for events name * event details should be used for additional information about event Change-Id: Id35105b0a0a7a832b1b291c45736dd8067bd2c26
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* http =//www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -31,3 +31,34 @@ export enum Execution {
|
||||
REACHABLE_CODE = 'reachable code',
|
||||
METHOD_USED = 'method used',
|
||||
}
|
||||
|
||||
export enum Timing {
|
||||
APP_STARTED = 'App Started',
|
||||
CHANGE_DISPLAYED = 'ChangeDisplayed',
|
||||
CHANGE_LOAD_FULL = 'ChangeFullyLoaded',
|
||||
DASHBOARD_DISPLAYED = 'DashboardDisplayed',
|
||||
DIFF_VIEW_CONTENT_DISPLAYED = 'DiffViewOnlyContent',
|
||||
DIFF_VIEW_DISPLAYED = 'DiffViewDisplayed',
|
||||
DIFF_VIEW_LOAD_FULL = 'DiffViewFullyLoaded',
|
||||
FILE_LIST_DISPLAYED = 'FileListDisplayed',
|
||||
PLUGINS_LOADED = 'PluginsLoaded',
|
||||
STARTUP_CHANGE_DISPLAYED = 'StartupChangeDisplayed',
|
||||
STARTUP_CHANGE_LOAD_FULL = 'StartupChangeFullyLoaded',
|
||||
STARTUP_DASHBOARD_DISPLAYED = 'StartupDashboardDisplayed',
|
||||
STARTUP_DIFF_VIEW_CONTENT_DISPLAYED = 'StartupDiffViewOnlyContent',
|
||||
STARTUP_DIFF_VIEW_DISPLAYED = 'StartupDiffViewDisplayed',
|
||||
STARTUP_DIFF_VIEW_LOAD_FULL = 'StartupDiffViewFullyLoaded',
|
||||
STARTUP_FILE_LIST_DISPLAYED = 'StartupFileListDisplayed',
|
||||
WEB_COMPONENTS_READY = 'WebComponentsReady',
|
||||
METRICS_PLUGIN_LOADED = 'MetricsPluginLoaded',
|
||||
CHANGE_DATA = 'ChangeDataLoaded',
|
||||
CHANGE_RELOAD = 'ChangeReloaded',
|
||||
SEND_REPLY = 'SendReply',
|
||||
DIFF_TOTAL = 'Diff Total Render',
|
||||
DIFF_CONTENT = 'Diff Content Render',
|
||||
DIFF_SYNTAX = 'Diff Syntax Render',
|
||||
FILE_RENDER = 'FileListRenderTime',
|
||||
FILE_RENDER_AVG = 'FileListRenderTimePerFile',
|
||||
FILE_EXPAND_ALL = 'ExpandAllDiffs',
|
||||
FILE_EXPAND_ALL_AVG = 'ExpandAllPerDiff',
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ import {aPluginHasRegistered$} from '../../../services/checks/checks-model';
|
||||
import {Subject} from 'rxjs';
|
||||
import {GrRelatedChangesListExperimental} from '../gr-related-changes-list-experimental/gr-related-changes-list-experimental';
|
||||
import {debounce, DelayedTask} from '../../../utils/async-util';
|
||||
import {Timing} from '../../../constants/reporting';
|
||||
|
||||
const CHANGE_ID_ERROR = {
|
||||
MISMATCH: 'mismatch',
|
||||
@@ -211,9 +212,6 @@ const ReloadToastMessage = {
|
||||
NEW_MESSAGE: 'There are new messages on this change',
|
||||
};
|
||||
|
||||
const CHANGE_DATA_TIMING_LABEL = 'ChangeDataLoaded';
|
||||
const CHANGE_RELOAD_TIMING_LABEL = 'ChangeReloaded';
|
||||
const SEND_REPLY_TIMING_LABEL = 'SendReply';
|
||||
// Making the tab names more unique in case a plugin adds one with same name
|
||||
const ROBOT_COMMENTS_LIMIT = 10;
|
||||
|
||||
@@ -1215,7 +1213,7 @@ export class GrChangeView extends KeyboardShortcutMixin(PolymerElement) {
|
||||
this.addEventListener(
|
||||
'change-details-loaded',
|
||||
() => {
|
||||
this.reporting.timeEnd(SEND_REPLY_TIMING_LABEL);
|
||||
this.reporting.timeEnd(Timing.SEND_REPLY);
|
||||
},
|
||||
{once: true}
|
||||
);
|
||||
@@ -2189,8 +2187,8 @@ export class GrChangeView extends KeyboardShortcutMixin(PolymerElement) {
|
||||
}
|
||||
this._loading = true;
|
||||
this._relatedChangesCollapsed = true;
|
||||
this.reporting.time(CHANGE_RELOAD_TIMING_LABEL);
|
||||
this.reporting.time(CHANGE_DATA_TIMING_LABEL);
|
||||
this.reporting.time(Timing.CHANGE_RELOAD);
|
||||
this.reporting.time(Timing.CHANGE_DATA);
|
||||
|
||||
// Array to house all promises related to data requests.
|
||||
const allDataPromises: Promise<unknown>[] = [];
|
||||
@@ -2209,7 +2207,7 @@ export class GrChangeView extends KeyboardShortcutMixin(PolymerElement) {
|
||||
fireEvent(this, 'change-details-loaded');
|
||||
})
|
||||
.then(() => {
|
||||
this.reporting.timeEnd(CHANGE_RELOAD_TIMING_LABEL);
|
||||
this.reporting.timeEnd(Timing.CHANGE_RELOAD);
|
||||
if (isLocationChange) {
|
||||
this.reporting.changeDisplayed();
|
||||
}
|
||||
@@ -2315,7 +2313,7 @@ export class GrChangeView extends KeyboardShortcutMixin(PolymerElement) {
|
||||
}
|
||||
|
||||
Promise.all(allDataPromises).then(() => {
|
||||
this.reporting.timeEnd(CHANGE_DATA_TIMING_LABEL);
|
||||
this.reporting.timeEnd(Timing.CHANGE_DATA);
|
||||
if (isLocationChange) {
|
||||
this.reporting.changeFullyLoaded();
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ import {PolymerSpliceChange} from '@polymer/polymer/interfaces';
|
||||
import {ChangeComments} from '../../diff/gr-comment-api/gr-comment-api';
|
||||
import {CustomKeyboardEvent} from '../../../types/events';
|
||||
import {ParsedChangeInfo, PatchSetFile} from '../../../types/types';
|
||||
import {Timing} from '../../../constants/reporting';
|
||||
|
||||
export const DEFAULT_NUM_FILES_SHOWN = 200;
|
||||
|
||||
@@ -85,11 +86,6 @@ const SIZE_BAR_MAX_WIDTH = 61;
|
||||
const SIZE_BAR_GAP_WIDTH = 1;
|
||||
const SIZE_BAR_MIN_WIDTH = 1.5;
|
||||
|
||||
const RENDER_TIMING_LABEL = 'FileListRenderTime';
|
||||
const RENDER_AVG_TIMING_LABEL = 'FileListRenderTimePerFile';
|
||||
const EXPAND_ALL_TIMING_LABEL = 'ExpandAllDiffs';
|
||||
const EXPAND_ALL_AVG_TIMING_LABEL = 'ExpandAllPerDiff';
|
||||
|
||||
const FILE_ROW_CLASS = 'file-row';
|
||||
|
||||
export interface GrFileList {
|
||||
@@ -557,7 +553,7 @@ export class GrFileList extends KeyboardShortcutMixin(PolymerElement) {
|
||||
return;
|
||||
}
|
||||
// Re-render all expanded diffs sequentially.
|
||||
this.reporting.time(EXPAND_ALL_TIMING_LABEL);
|
||||
this.reporting.time(Timing.FILE_EXPAND_ALL);
|
||||
this._renderInOrder(
|
||||
this._expandedFiles,
|
||||
this.diffs,
|
||||
@@ -1275,7 +1271,7 @@ export class GrFileList extends KeyboardShortcutMixin(PolymerElement) {
|
||||
// Start the timer for the rendering work hwere because this is where the
|
||||
// _shownFiles property is being set, and _shownFiles is used in the
|
||||
// dom-repeat binding.
|
||||
this.reporting.time(RENDER_TIMING_LABEL);
|
||||
this.reporting.time(Timing.FILE_RENDER);
|
||||
|
||||
// How many more files are being shown (if it's an increase).
|
||||
this._reportinShownFilesIncrement = Math.max(
|
||||
@@ -1423,7 +1419,7 @@ export class GrFileList extends KeyboardShortcutMixin(PolymerElement) {
|
||||
// Required so that the newly created diff view is included in this.diffs.
|
||||
flush();
|
||||
|
||||
this.reporting.time(EXPAND_ALL_TIMING_LABEL);
|
||||
this.reporting.time(Timing.FILE_EXPAND_ALL);
|
||||
|
||||
if (newFiles.length) {
|
||||
this._renderInOrder(newFiles, this.diffs, newFiles.length);
|
||||
@@ -1502,8 +1498,8 @@ export class GrFileList extends KeyboardShortcutMixin(PolymerElement) {
|
||||
this._cancelForEachDiff = undefined;
|
||||
console.info('Finished expanding', initialCount, 'diff(s)');
|
||||
this.reporting.timeEndWithAverage(
|
||||
EXPAND_ALL_TIMING_LABEL,
|
||||
EXPAND_ALL_AVG_TIMING_LABEL,
|
||||
Timing.FILE_EXPAND_ALL,
|
||||
Timing.FILE_EXPAND_ALL_AVG,
|
||||
initialCount
|
||||
);
|
||||
/* Block diff cursor from auto scrolling after files are done rendering.
|
||||
@@ -1783,8 +1779,8 @@ export class GrFileList extends KeyboardShortcutMixin(PolymerElement) {
|
||||
if (index === this._shownFiles.length - 1) {
|
||||
setTimeout(() => {
|
||||
this.reporting.timeEndWithAverage(
|
||||
RENDER_TIMING_LABEL,
|
||||
RENDER_AVG_TIMING_LABEL,
|
||||
Timing.FILE_RENDER,
|
||||
Timing.FILE_RENDER_AVG,
|
||||
this._reportinShownFilesIncrement
|
||||
);
|
||||
}, 1);
|
||||
|
||||
@@ -113,6 +113,7 @@ import {
|
||||
import {ErrorCallback} from '../../../api/rest';
|
||||
import {debounce, DelayedTask} from '../../../utils/async-util';
|
||||
import {StorageLocation} from '../../../services/storage/gr-storage';
|
||||
import {Timing} from '../../../constants/reporting';
|
||||
|
||||
const STORAGE_DEBOUNCE_INTERVAL_MS = 400;
|
||||
|
||||
@@ -148,8 +149,6 @@ const ButtonTooltips = {
|
||||
|
||||
const EMPTY_REPLY_MESSAGE = 'Cannot send an empty reply.';
|
||||
|
||||
const SEND_REPLY_TIMING_LABEL = 'SendReply';
|
||||
|
||||
interface PendingRemovals {
|
||||
CC: (AccountInfoInput | GroupInfoInput)[];
|
||||
REVIEWER: (AccountInfoInput | GroupInfoInput)[];
|
||||
@@ -643,7 +642,7 @@ export class GrReplyDialog extends KeyboardShortcutMixin(PolymerElement) {
|
||||
includeComments: boolean,
|
||||
startReview: boolean
|
||||
): Promise<Map<AccountId | EmailAddress, boolean>> {
|
||||
this.reporting.time(SEND_REPLY_TIMING_LABEL);
|
||||
this.reporting.time(Timing.SEND_REPLY);
|
||||
const labels = this.$.labelScores.getLabelValues();
|
||||
|
||||
const reviewInput: ReviewInput = {
|
||||
|
||||
@@ -73,7 +73,7 @@ import {
|
||||
toPathname,
|
||||
toSearchParams,
|
||||
} from '../../../utils/url-util';
|
||||
import {Execution, LifeCycle} from '../../../constants/reporting';
|
||||
import {Execution, LifeCycle, Timing} from '../../../constants/reporting';
|
||||
|
||||
const RoutePattern = {
|
||||
ROOT: '/',
|
||||
@@ -267,7 +267,7 @@ if (!app) {
|
||||
// Setup listeners outside of the router component initialization.
|
||||
(function () {
|
||||
window.addEventListener('WebComponentsReady', () => {
|
||||
appContext.reportingService.timeEnd('WebComponentsReady');
|
||||
appContext.reportingService.timeEnd(Timing.WEB_COMPONENTS_READY);
|
||||
});
|
||||
})();
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ import {
|
||||
import {getPluginLoader} from '../../shared/gr-js-api-interface/gr-plugin-loader';
|
||||
import {assertIsDefined} from '../../../utils/common-util';
|
||||
import {DiffContextExpandedEventDetail} from '../gr-diff-builder/gr-diff-builder';
|
||||
import {Timing} from '../../../constants/reporting';
|
||||
|
||||
const MSG_EMPTY_BLAME = 'No blame information for this diff.';
|
||||
|
||||
@@ -86,12 +87,6 @@ const EVENT_AGAINST_PARENT = 'diff-against-parent';
|
||||
const EVENT_ZERO_REBASE = 'rebase-percent-zero';
|
||||
const EVENT_NONZERO_REBASE = 'rebase-percent-nonzero';
|
||||
|
||||
const TimingLabel = {
|
||||
TOTAL: 'Diff Total Render',
|
||||
CONTENT: 'Diff Content Render',
|
||||
SYNTAX: 'Diff Syntax Render',
|
||||
};
|
||||
|
||||
// Disable syntax highlighting if the overall diff is too large.
|
||||
const SYNTAX_MAX_DIFF_LENGTH = 20000;
|
||||
|
||||
@@ -383,11 +378,11 @@ export class GrDiffHost extends PolymerElement {
|
||||
}
|
||||
const needsSyntaxHighlighting = !!event.detail?.contentRendered;
|
||||
if (needsSyntaxHighlighting) {
|
||||
this.reporting.time(TimingLabel.SYNTAX);
|
||||
this.reporting.time(Timing.DIFF_SYNTAX);
|
||||
try {
|
||||
await this.syntaxLayer.process();
|
||||
} finally {
|
||||
this.reporting.timeEnd(TimingLabel.SYNTAX);
|
||||
this.reporting.timeEnd(Timing.DIFF_SYNTAX);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -397,7 +392,7 @@ export class GrDiffHost extends PolymerElement {
|
||||
console.warn('Error encountered loading diff:', e);
|
||||
}
|
||||
} finally {
|
||||
this.reporting.timeEnd(TimingLabel.TOTAL);
|
||||
this.reporting.timeEnd(Timing.DIFF_TOTAL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1051,12 +1046,12 @@ export class GrDiffHost extends PolymerElement {
|
||||
}
|
||||
|
||||
_handleRenderStart() {
|
||||
this.reporting.time(TimingLabel.TOTAL);
|
||||
this.reporting.time(TimingLabel.CONTENT);
|
||||
this.reporting.time(Timing.DIFF_TOTAL);
|
||||
this.reporting.time(Timing.DIFF_CONTENT);
|
||||
}
|
||||
|
||||
_handleRenderContent() {
|
||||
this.reporting.timeEnd(TimingLabel.CONTENT);
|
||||
this.reporting.timeEnd(Timing.DIFF_CONTENT);
|
||||
}
|
||||
|
||||
_handleNormalizeRange(event: CustomEvent) {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import {NumericChangeId} from '../../types/common';
|
||||
import {EventDetails} from '../../api/reporting';
|
||||
import {PluginApi} from '../../api/plugin';
|
||||
import {Execution, LifeCycle} from '../../constants/reporting';
|
||||
import {Execution, LifeCycle, Timing} from '../../constants/reporting';
|
||||
|
||||
export type EventValue = string | number | {error?: Error};
|
||||
|
||||
@@ -56,11 +56,11 @@ export interface ReportingService {
|
||||
/**
|
||||
* Reset named timer.
|
||||
*/
|
||||
time(name: string): void;
|
||||
time(name: Timing): void;
|
||||
/**
|
||||
* Finish named timer and report it to server.
|
||||
*/
|
||||
timeEnd(name: string, eventDetails?: EventDetails): void;
|
||||
timeEnd(name: Timing, eventDetails?: EventDetails): void;
|
||||
/**
|
||||
* Reports just line timeEnd, but additionally reports an average given a
|
||||
* denominator and a separate reporting name for the average.
|
||||
@@ -71,8 +71,8 @@ export interface ReportingService {
|
||||
* compute the average.
|
||||
*/
|
||||
timeEndWithAverage(
|
||||
name: string,
|
||||
averageName: string,
|
||||
name: Timing,
|
||||
averageName: Timing,
|
||||
denominator: number
|
||||
): void;
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@ import {hasOwnProperty} from '../../utils/common-util';
|
||||
import {NumericChangeId} from '../../types/common';
|
||||
import {EventDetails} from '../../api/reporting';
|
||||
import {PluginApi} from '../../api/plugin';
|
||||
import {Execution, LifeCycle} from '../../constants/reporting';
|
||||
import {Execution, LifeCycle, Timing} from '../../constants/reporting';
|
||||
|
||||
// Latency reporting constants.
|
||||
|
||||
@@ -31,9 +31,6 @@ const TIMING = {
|
||||
UI_LATENCY: 'UI Latency',
|
||||
RPC: 'RPC Timing',
|
||||
},
|
||||
EVENT: {
|
||||
APP_STARTED: 'App Started',
|
||||
},
|
||||
};
|
||||
|
||||
const LIFECYCLE = {
|
||||
@@ -73,39 +70,19 @@ const ERROR = {
|
||||
},
|
||||
};
|
||||
|
||||
const TIMER = {
|
||||
CHANGE_DISPLAYED: 'ChangeDisplayed',
|
||||
CHANGE_LOAD_FULL: 'ChangeFullyLoaded',
|
||||
DASHBOARD_DISPLAYED: 'DashboardDisplayed',
|
||||
DIFF_VIEW_CONTENT_DISPLAYED: 'DiffViewOnlyContent',
|
||||
DIFF_VIEW_DISPLAYED: 'DiffViewDisplayed',
|
||||
DIFF_VIEW_LOAD_FULL: 'DiffViewFullyLoaded',
|
||||
FILE_LIST_DISPLAYED: 'FileListDisplayed',
|
||||
PLUGINS_LOADED: 'PluginsLoaded',
|
||||
STARTUP_CHANGE_DISPLAYED: 'StartupChangeDisplayed',
|
||||
STARTUP_CHANGE_LOAD_FULL: 'StartupChangeFullyLoaded',
|
||||
STARTUP_DASHBOARD_DISPLAYED: 'StartupDashboardDisplayed',
|
||||
STARTUP_DIFF_VIEW_CONTENT_DISPLAYED: 'StartupDiffViewOnlyContent',
|
||||
STARTUP_DIFF_VIEW_DISPLAYED: 'StartupDiffViewDisplayed',
|
||||
STARTUP_DIFF_VIEW_LOAD_FULL: 'StartupDiffViewFullyLoaded',
|
||||
STARTUP_FILE_LIST_DISPLAYED: 'StartupFileListDisplayed',
|
||||
WEB_COMPONENTS_READY: 'WebComponentsReady',
|
||||
METRICS_PLUGIN_LOADED: 'MetricsPluginLoaded',
|
||||
};
|
||||
|
||||
const STARTUP_TIMERS = {
|
||||
[TIMER.PLUGINS_LOADED]: 0,
|
||||
[TIMER.METRICS_PLUGIN_LOADED]: 0,
|
||||
[TIMER.STARTUP_CHANGE_DISPLAYED]: 0,
|
||||
[TIMER.STARTUP_CHANGE_LOAD_FULL]: 0,
|
||||
[TIMER.STARTUP_DASHBOARD_DISPLAYED]: 0,
|
||||
[TIMER.STARTUP_DIFF_VIEW_CONTENT_DISPLAYED]: 0,
|
||||
[TIMER.STARTUP_DIFF_VIEW_DISPLAYED]: 0,
|
||||
[TIMER.STARTUP_DIFF_VIEW_LOAD_FULL]: 0,
|
||||
[TIMER.STARTUP_FILE_LIST_DISPLAYED]: 0,
|
||||
[TIMING.EVENT.APP_STARTED]: 0,
|
||||
const STARTUP_TIMERS: {[name: string]: number} = {
|
||||
[Timing.PLUGINS_LOADED]: 0,
|
||||
[Timing.METRICS_PLUGIN_LOADED]: 0,
|
||||
[Timing.STARTUP_CHANGE_DISPLAYED]: 0,
|
||||
[Timing.STARTUP_CHANGE_LOAD_FULL]: 0,
|
||||
[Timing.STARTUP_DASHBOARD_DISPLAYED]: 0,
|
||||
[Timing.STARTUP_DIFF_VIEW_CONTENT_DISPLAYED]: 0,
|
||||
[Timing.STARTUP_DIFF_VIEW_DISPLAYED]: 0,
|
||||
[Timing.STARTUP_DIFF_VIEW_LOAD_FULL]: 0,
|
||||
[Timing.STARTUP_FILE_LIST_DISPLAYED]: 0,
|
||||
[Timing.APP_STARTED]: 0,
|
||||
// WebComponentsReady timer is triggered from gr-router.
|
||||
[TIMER.WEB_COMPONENTS_READY]: 0,
|
||||
[Timing.WEB_COMPONENTS_READY]: 0,
|
||||
};
|
||||
|
||||
const DRAFT_ACTION_TIMER = 'TimeBetweenDraftActions';
|
||||
@@ -328,7 +305,7 @@ export class GrReporting implements ReportingService {
|
||||
|
||||
private _arePluginsLoaded() {
|
||||
return (
|
||||
this._baselines && !hasOwnProperty(this._baselines, TIMER.PLUGINS_LOADED)
|
||||
this._baselines && !hasOwnProperty(this._baselines, Timing.PLUGINS_LOADED)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -336,7 +313,7 @@ export class GrReporting implements ReportingService {
|
||||
return (
|
||||
this._arePluginsLoaded() ||
|
||||
(this._baselines &&
|
||||
!hasOwnProperty(this._baselines, TIMER.METRICS_PLUGIN_LOADED))
|
||||
!hasOwnProperty(this._baselines, Timing.METRICS_PLUGIN_LOADED))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -444,7 +421,7 @@ export class GrReporting implements ReportingService {
|
||||
* User-perceived app start time, should be reported when the app is ready.
|
||||
*/
|
||||
appStarted() {
|
||||
this.timeEnd(TIMING.EVENT.APP_STARTED);
|
||||
this.timeEnd(Timing.APP_STARTED);
|
||||
this._reportNavResTimes();
|
||||
}
|
||||
|
||||
@@ -502,13 +479,13 @@ export class GrReporting implements ReportingService {
|
||||
for (const prop of Object.keys(this._baselines)) {
|
||||
delete this._baselines[prop];
|
||||
}
|
||||
this.time(TIMER.CHANGE_DISPLAYED);
|
||||
this.time(TIMER.CHANGE_LOAD_FULL);
|
||||
this.time(TIMER.DASHBOARD_DISPLAYED);
|
||||
this.time(TIMER.DIFF_VIEW_CONTENT_DISPLAYED);
|
||||
this.time(TIMER.DIFF_VIEW_DISPLAYED);
|
||||
this.time(TIMER.DIFF_VIEW_LOAD_FULL);
|
||||
this.time(TIMER.FILE_LIST_DISPLAYED);
|
||||
this.time(Timing.CHANGE_DISPLAYED);
|
||||
this.time(Timing.CHANGE_LOAD_FULL);
|
||||
this.time(Timing.DASHBOARD_DISPLAYED);
|
||||
this.time(Timing.DIFF_VIEW_CONTENT_DISPLAYED);
|
||||
this.time(Timing.DIFF_VIEW_DISPLAYED);
|
||||
this.time(Timing.DIFF_VIEW_LOAD_FULL);
|
||||
this.time(Timing.FILE_LIST_DISPLAYED);
|
||||
this.reportRepoName = undefined;
|
||||
this.reportChangeId = undefined;
|
||||
// reset slow rpc list since here start page loads which report these rpcs
|
||||
@@ -526,60 +503,63 @@ export class GrReporting implements ReportingService {
|
||||
}
|
||||
|
||||
dashboardDisplayed() {
|
||||
if (hasOwnProperty(this._baselines, TIMER.STARTUP_DASHBOARD_DISPLAYED)) {
|
||||
this.timeEnd(TIMER.STARTUP_DASHBOARD_DISPLAYED, this._pageLoadDetails());
|
||||
if (hasOwnProperty(this._baselines, Timing.STARTUP_DASHBOARD_DISPLAYED)) {
|
||||
this.timeEnd(Timing.STARTUP_DASHBOARD_DISPLAYED, this._pageLoadDetails());
|
||||
} else {
|
||||
this.timeEnd(TIMER.DASHBOARD_DISPLAYED, this._pageLoadDetails());
|
||||
this.timeEnd(Timing.DASHBOARD_DISPLAYED, this._pageLoadDetails());
|
||||
}
|
||||
}
|
||||
|
||||
changeDisplayed() {
|
||||
if (hasOwnProperty(this._baselines, TIMER.STARTUP_CHANGE_DISPLAYED)) {
|
||||
this.timeEnd(TIMER.STARTUP_CHANGE_DISPLAYED, this._pageLoadDetails());
|
||||
if (hasOwnProperty(this._baselines, Timing.STARTUP_CHANGE_DISPLAYED)) {
|
||||
this.timeEnd(Timing.STARTUP_CHANGE_DISPLAYED, this._pageLoadDetails());
|
||||
} else {
|
||||
this.timeEnd(TIMER.CHANGE_DISPLAYED, this._pageLoadDetails());
|
||||
this.timeEnd(Timing.CHANGE_DISPLAYED, this._pageLoadDetails());
|
||||
}
|
||||
}
|
||||
|
||||
changeFullyLoaded() {
|
||||
if (hasOwnProperty(this._baselines, TIMER.STARTUP_CHANGE_LOAD_FULL)) {
|
||||
this.timeEnd(TIMER.STARTUP_CHANGE_LOAD_FULL);
|
||||
if (hasOwnProperty(this._baselines, Timing.STARTUP_CHANGE_LOAD_FULL)) {
|
||||
this.timeEnd(Timing.STARTUP_CHANGE_LOAD_FULL);
|
||||
} else {
|
||||
this.timeEnd(TIMER.CHANGE_LOAD_FULL);
|
||||
this.timeEnd(Timing.CHANGE_LOAD_FULL);
|
||||
}
|
||||
}
|
||||
|
||||
diffViewDisplayed() {
|
||||
if (hasOwnProperty(this._baselines, TIMER.STARTUP_DIFF_VIEW_DISPLAYED)) {
|
||||
this.timeEnd(TIMER.STARTUP_DIFF_VIEW_DISPLAYED, this._pageLoadDetails());
|
||||
if (hasOwnProperty(this._baselines, Timing.STARTUP_DIFF_VIEW_DISPLAYED)) {
|
||||
this.timeEnd(Timing.STARTUP_DIFF_VIEW_DISPLAYED, this._pageLoadDetails());
|
||||
} else {
|
||||
this.timeEnd(TIMER.DIFF_VIEW_DISPLAYED, this._pageLoadDetails());
|
||||
this.timeEnd(Timing.DIFF_VIEW_DISPLAYED, this._pageLoadDetails());
|
||||
}
|
||||
}
|
||||
|
||||
diffViewFullyLoaded() {
|
||||
if (hasOwnProperty(this._baselines, TIMER.STARTUP_DIFF_VIEW_LOAD_FULL)) {
|
||||
this.timeEnd(TIMER.STARTUP_DIFF_VIEW_LOAD_FULL);
|
||||
if (hasOwnProperty(this._baselines, Timing.STARTUP_DIFF_VIEW_LOAD_FULL)) {
|
||||
this.timeEnd(Timing.STARTUP_DIFF_VIEW_LOAD_FULL);
|
||||
} else {
|
||||
this.timeEnd(TIMER.DIFF_VIEW_LOAD_FULL);
|
||||
this.timeEnd(Timing.DIFF_VIEW_LOAD_FULL);
|
||||
}
|
||||
}
|
||||
|
||||
diffViewContentDisplayed() {
|
||||
if (
|
||||
hasOwnProperty(this._baselines, TIMER.STARTUP_DIFF_VIEW_CONTENT_DISPLAYED)
|
||||
hasOwnProperty(
|
||||
this._baselines,
|
||||
Timing.STARTUP_DIFF_VIEW_CONTENT_DISPLAYED
|
||||
)
|
||||
) {
|
||||
this.timeEnd(TIMER.STARTUP_DIFF_VIEW_CONTENT_DISPLAYED);
|
||||
this.timeEnd(Timing.STARTUP_DIFF_VIEW_CONTENT_DISPLAYED);
|
||||
} else {
|
||||
this.timeEnd(TIMER.DIFF_VIEW_CONTENT_DISPLAYED);
|
||||
this.timeEnd(Timing.DIFF_VIEW_CONTENT_DISPLAYED);
|
||||
}
|
||||
}
|
||||
|
||||
fileListDisplayed() {
|
||||
if (hasOwnProperty(this._baselines, TIMER.STARTUP_FILE_LIST_DISPLAYED)) {
|
||||
this.timeEnd(TIMER.STARTUP_FILE_LIST_DISPLAYED);
|
||||
if (hasOwnProperty(this._baselines, Timing.STARTUP_FILE_LIST_DISPLAYED)) {
|
||||
this.timeEnd(Timing.STARTUP_FILE_LIST_DISPLAYED);
|
||||
} else {
|
||||
this.timeEnd(TIMER.FILE_LIST_DISPLAYED);
|
||||
this.timeEnd(Timing.FILE_LIST_DISPLAYED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -625,12 +605,12 @@ export class GrReporting implements ReportingService {
|
||||
|
||||
pluginLoaded(name: string) {
|
||||
if (name.startsWith('metrics-')) {
|
||||
this.timeEnd(TIMER.METRICS_PLUGIN_LOADED);
|
||||
this.timeEnd(Timing.METRICS_PLUGIN_LOADED);
|
||||
}
|
||||
}
|
||||
|
||||
pluginsLoaded(pluginsList?: string[]) {
|
||||
this.timeEnd(TIMER.PLUGINS_LOADED);
|
||||
this.timeEnd(Timing.PLUGINS_LOADED);
|
||||
this.reporter(
|
||||
LIFECYCLE.TYPE,
|
||||
LIFECYCLE.CATEGORY.PLUGINS_INSTALLED,
|
||||
@@ -642,9 +622,9 @@ export class GrReporting implements ReportingService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset named timer.
|
||||
* Reset named Timing.
|
||||
*/
|
||||
time(name: string) {
|
||||
time(name: Timing) {
|
||||
this._baselines[name] = now();
|
||||
window.performance.mark(`${name}-start`);
|
||||
}
|
||||
@@ -652,7 +632,7 @@ export class GrReporting implements ReportingService {
|
||||
/**
|
||||
* Finish named timer and report it to server.
|
||||
*/
|
||||
timeEnd(name: string, eventDetails?: EventDetails) {
|
||||
timeEnd(name: Timing, eventDetails?: EventDetails) {
|
||||
if (!hasOwnProperty(this._baselines, name)) {
|
||||
return;
|
||||
}
|
||||
@@ -680,7 +660,7 @@ export class GrReporting implements ReportingService {
|
||||
* @param denominator Number by which to divide the total to
|
||||
* compute the average.
|
||||
*/
|
||||
timeEndWithAverage(name: string, averageName: string, denominator: number) {
|
||||
timeEndWithAverage(name: Timing, averageName: Timing, denominator: number) {
|
||||
if (!hasOwnProperty(this._baselines, name)) {
|
||||
return;
|
||||
}
|
||||
@@ -830,7 +810,7 @@ export class GrReporting implements ReportingService {
|
||||
|
||||
/**
|
||||
* A draft interaction was started. Update the time-between-draft-actions
|
||||
* timer.
|
||||
* Timing.
|
||||
*/
|
||||
recordDraftInteraction() {
|
||||
// If there is no timer defined, then this is the first interaction.
|
||||
|
||||
Reference in New Issue
Block a user