always send perf-tick telemetry from perf bot (#171046)

This commit is contained in:
Johannes Rieken 2023-01-11 11:15:33 +01:00 committed by GitHub
parent c82c88f53a
commit 82d49f1649
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View file

@ -478,6 +478,7 @@ export abstract class AbstractTimerService implements ITimerService {
private readonly _barrier = new Barrier();
private readonly _marks = new PerfMarks();
private readonly rndValueShouldSendTelemetry = Math.random() < .3;
private _startupMetrics?: IStartupMetrics;
@ -581,13 +582,15 @@ export abstract class AbstractTimerService implements ITimerService {
this._telemetryService.publicLog('startupTimeVaried', metrics);
}
private readonly _shouldReportPerfMarks = Math.random() < .3;
protected _shouldReportPerfMarks(): boolean {
return this.rndValueShouldSendTelemetry;
}
private _reportPerformanceMarks(source: string, marks: perf.PerformanceMark[]) {
if (!this._shouldReportPerfMarks) {
if (!this._shouldReportPerfMarks()) {
// the `startup.timer.mark` event is send very often. In order to save resources
// we let only a third of our instances send this event
// we let some of our instances/sessions send this event
return;
}

View file

@ -83,6 +83,11 @@ export class TimerService extends AbstractTimerService {
// ignore, be on the safe side with these hardware method calls
}
}
protected override _shouldReportPerfMarks(): boolean {
// always send when running with the prof-append-timers flag
return super._shouldReportPerfMarks() || Boolean(this._environmentService.args['prof-append-timers']);
}
}
registerSingleton(ITimerService, TimerService, InstantiationType.Delayed);