Fix SEND_REPLY metric
Release-Notes: skip
Change-Id: I5f4e8592e50b376350228318472b3cf25d40689d
diff --git a/polygerrit-ui/app/services/gr-reporting/gr-reporting_impl.ts b/polygerrit-ui/app/services/gr-reporting/gr-reporting_impl.ts
index b8758e2..61534a4 100644
--- a/polygerrit-ui/app/services/gr-reporting/gr-reporting_impl.ts
+++ b/polygerrit-ui/app/services/gr-reporting/gr-reporting_impl.ts
@@ -88,6 +88,9 @@
[Timing.WEB_COMPONENTS_READY]: 0,
};
+// List of timers that should NOT be reset before a location change.
+const LOCATION_CHANGE_OK_TIMERS: (string | Timing)[] = [Timing.SEND_REPLY];
+
const SLOW_RPC_THRESHOLD = 500;
export function initErrorReporter(reportingService: ReportingService) {
@@ -600,6 +603,7 @@
beforeLocationChanged() {
for (const prop of Object.keys(this._baselines)) {
+ if (LOCATION_CHANGE_OK_TIMERS.includes(prop)) continue;
delete this._baselines[prop];
}
this.time(Timing.CHANGE_DISPLAYED);