Update backup benchmark timing

This commit is contained in:
trevor-signal 2024-11-13 12:31:13 -05:00 committed by GitHub
parent ca20d07f75
commit 5762c8a37f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 9 deletions

View file

@ -302,7 +302,7 @@ export class BackupsService {
log.info(`importBackup: starting ${backupType}...`); log.info(`importBackup: starting ${backupType}...`);
this.isRunning = 'import'; this.isRunning = 'import';
const importStart = Date.now();
try { try {
const importStream = await BackupImportStream.create(backupType); const importStream = await BackupImportStream.create(backupType);
if (backupType === BackupType.Ciphertext) { if (backupType === BackupType.Ciphertext) {
@ -390,7 +390,9 @@ export class BackupsService {
this.isRunning = false; this.isRunning = false;
window.IPC.stopTrackingQueryStats({ epochName: 'Backup Import' }); window.IPC.stopTrackingQueryStats({ epochName: 'Backup Import' });
if (window.SignalCI) { if (window.SignalCI) {
window.SignalCI.handleEvent('backupImportComplete', null); window.SignalCI.handleEvent('backupImportComplete', {
duration: Date.now() - importStart,
});
} }
} }
} }

View file

@ -19,19 +19,15 @@ Bootstrap.benchmark(async (bootstrap: Bootstrap): Promise<void> => {
await server.storeBackupOnCdn(backupId, backupStream); await server.storeBackupOnCdn(backupId, backupStream);
const importStart = Date.now();
const app = await bootstrap.link(); const app = await bootstrap.link();
await app.waitForBackupImportComplete(); const { duration: importDuration } = await app.waitForBackupImportComplete();
const importEnd = Date.now();
const exportStart = Date.now(); const exportStart = Date.now();
await app.uploadBackup(); await app.uploadBackup();
const exportEnd = Date.now(); const exportEnd = Date.now();
console.log('run=%d info=%j', 0, { console.log('run=%d info=%j', 0, {
importDuration: importEnd - importStart, importDuration,
exportDuration: exportEnd - exportStart, exportDuration: exportEnd - exportStart,
}); });
}); });

View file

@ -109,7 +109,7 @@ export class App extends EventEmitter {
return this.waitForEvent('contactSync'); return this.waitForEvent('contactSync');
} }
public async waitForBackupImportComplete(): Promise<void> { public async waitForBackupImportComplete(): Promise<{ duration: number }> {
return this.waitForEvent('backupImportComplete'); return this.waitForEvent('backupImportComplete');
} }