-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(benchmark): add very basic benchmarking #95
Conversation
a6feb83
to
fc3c0fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OOC do these changes intersect with the code we're adding here? If so - should we colocate it in the SDK?
3a90559
to
f5feb13
Compare
looks like theres overlap. didnt know anything about this, will leave up to alex to decide how to proceed with this |
0c524f5
to
7d72436
Compare
@@ -95,7 +113,32 @@ export async function Main(config: parseEnv.Config, logger: winston.Logger) { | |||
new SpokePoolRepository(postgres, logger), | |||
redisCache, | |||
indexerQueuesService, | |||
write, | |||
(params: { type: WebhookTypes; event: JSONValue }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are repurposing the webhook callback to also stop any deposit benchmarks
@@ -117,6 +160,11 @@ export async function Main(config: parseEnv.Config, logger: winston.Logger) { | |||
retryProvidersFactory, | |||
); | |||
|
|||
const stopDepositListener = listenForDeposits( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a separate listener that listens straight on the contract for new deposits, given providers on various chains
chainId: number; | ||
}; | ||
|
||
export function listenForDeposits( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function takes providers and listens to specific events on the spoke pool. it does this to start profiling a deposit. it will end when indexer finds and updates it
const uniqueId = `${depositStatusEvent.originChainId}-${depositStatusEvent.depositId}`; | ||
try { | ||
const duration = depositBenchmark.end(uniqueId); | ||
logger.debug({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heres where we log the time. duration is in MS since start was called
acaad39
to
032d92b
Compare
// ignore errors, but it can happen if we are ending before starting | ||
} | ||
} | ||
write(params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we still call the write callback to webhook
Signed-off-by: david <[email protected]>
032d92b
to
bfeb627
Compare
closing this in favor of #129 |
motivation
we want to know how long it takes to process deposit events
changes