Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: more canary timings #2215

Merged
merged 6 commits into from
May 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions apps/laboratory/tests/shared/fixtures/w3m-wallet-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,46 @@ export const testConnectedMW = base.extend<ModalWalletFixture>({
} else {
timeStart('doActionAndWaitForNewPage')
const page = await doActionAndWaitForNewPage(modalPage.clickWalletDeeplink(), context)
let pairingCreatedTime: Date | null = null
let verificationStartedTime: Date | null = null
page.on('console', msg => {
if (msg.text().includes('set') && msg.text().includes('core/pairing/pairing')) {
pairingCreatedTime = new Date()
}
if (msg.text().includes('resolving attestation')) {
verificationStartedTime = new Date()
}
if (msg.text().includes('session_proposal') && msg.text().includes('verifyContext')) {
// For some reason this log is emitted twice; so only recording the time once
if (verificationStartedTime) {
const verificationEndedTime = new Date()
timingRecords.push({
item: 'sessionProposalVerification',
timeMs: verificationEndedTime.getTime() - verificationStartedTime.getTime()
})
verificationStartedTime = null
}
}
})
timeEnd('doActionAndWaitForNewPage')
const connectionInitiated = new Date()
timeStart('new WalletPage')
const walletPage = new WalletPage(page)
timeEnd('new WalletPage')
timeStart('walletPage.handleSessionProposal')
await walletPage.handleSessionProposal(DEFAULT_SESSION_PARAMS)
timeEnd('walletPage.handleSessionProposal')
const proposalReceived = new Date()
timingRecords.push({
item: 'deeplinkReceiveSessionProposal',
timeMs: proposalReceived.getTime() - connectionInitiated.getTime()
})
if (pairingCreatedTime) {
timingRecords.push({
item: 'pairingReceiveSessionProposal',
timeMs: proposalReceived.getTime() - (pairingCreatedTime as Date).getTime()
chris13524 marked this conversation as resolved.
Show resolved Hide resolved
})
}
await use(walletPage)
}
},
Expand Down
Loading