fix start since launch metric (#5433)
This commit is contained in:
parent
66cc51d06e
commit
2cc4b00431
2 changed files with 13 additions and 10 deletions
|
|
@ -76,9 +76,7 @@ const launchApp = (credentials) => {
|
|||
resetToSelectServer(emmProvider.allowOtherServers);
|
||||
}
|
||||
|
||||
if (!EphemeralStore.appStarted) {
|
||||
telemetry.startSinceLaunch(credentials ? 'Launch on Channel Screen' : 'Launch on Server Screen');
|
||||
}
|
||||
telemetry.startSinceLaunch(credentials ? 'Launch on Channel Screen' : 'Launch on Server Screen');
|
||||
});
|
||||
|
||||
EphemeralStore.appStarted = true;
|
||||
|
|
|
|||
|
|
@ -19,10 +19,12 @@ export const PERF_MARKERS = {
|
|||
class Telemetry {
|
||||
metrics: PerfMetric[];
|
||||
currentMetrics: Record<string, PerfMetric>;
|
||||
started: boolean;
|
||||
|
||||
constructor() {
|
||||
this.metrics = [];
|
||||
this.currentMetrics = {};
|
||||
this.started = false;
|
||||
}
|
||||
|
||||
getMetrics = () => {
|
||||
|
|
@ -62,14 +64,17 @@ class Telemetry {
|
|||
}
|
||||
|
||||
startSinceLaunch(extra = '') {
|
||||
getTimeSinceStartup().then((endTime) => {
|
||||
this.metrics.push({
|
||||
extra,
|
||||
name: PERF_MARKERS.START_SINCE_LAUNCH,
|
||||
startTime: 0,
|
||||
endTime,
|
||||
if (!this.started) {
|
||||
this.started = true;
|
||||
getTimeSinceStartup().then((endTime) => {
|
||||
this.metrics.push({
|
||||
extra,
|
||||
name: PERF_MARKERS.START_SINCE_LAUNCH,
|
||||
startTime: 0,
|
||||
endTime,
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
remove(names = []) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue