1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-28 15:22:05 +03:00

Performance monitoring measurements (#6041)

This commit is contained in:
Germain
2021-05-19 10:07:02 +01:00
committed by GitHub
parent cf384c2a54
commit f7d0afcd28
7 changed files with 275 additions and 32 deletions

View File

@ -79,8 +79,26 @@ async function runTests() {
await new Promise((resolve) => setTimeout(resolve, 5 * 60 * 1000));
}
await Promise.all(sessions.map((session) => session.close()));
const performanceEntries = {};
await Promise.all(sessions.map(async (session) => {
// Collecting all performance monitoring data before closing the session
const measurements = await session.page.evaluate(() => {
let measurements = [];
window.mxPerformanceMonitor.addPerformanceDataCallback({
entryNames: [
window.mxPerformanceEntryNames.REGISTER,
],
callback: (events) => {
measurements = JSON.stringify(events);
},
}, true);
return measurements;
});
performanceEntries[session.username] = JSON.parse(measurements);
return session.close();
}));
fs.writeFileSync(`performance-entries.json`, JSON.stringify(performanceEntries));
if (failure) {
process.exit(-1);
} else {