-
Notifications
You must be signed in to change notification settings - Fork 416
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 granular metrics for routes/quotes fetched #756
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,6 +205,11 @@ export class V2Quoter extends BaseQuoter<V2CandidatePools, V2Route, Token> { | |
MetricLoggerUnit.Milliseconds | ||
); | ||
|
||
metric.putMetric( | ||
`V2QuotesLoad_Chain_${this.chainId}`, | ||
Date.now() - beforeQuotes | ||
); | ||
|
||
metric.putMetric( | ||
'V2QuotesFetched', | ||
_(routesWithQuotes) | ||
|
@@ -213,6 +218,20 @@ export class V2Quoter extends BaseQuoter<V2CandidatePools, V2Route, Token> { | |
MetricLoggerUnit.Count | ||
); | ||
|
||
metric.putMetric( | ||
`V2QuotesFetched_Chain_${this.chainId}`, | ||
_(routesWithQuotes) | ||
.map(([, quotes]) => quotes.length) | ||
.sum() | ||
); | ||
|
||
metric.putMetric(`V2RoutesFetched`, _(routesWithQuotes).sum()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so this logs the routes fetched in case we have a cache routes miss. in case we have a cached routes hit, it will be within refreshRoutesThenGetQuotes. I'm thinking (1) whether we should log routes and/or quotes fetched in case of cached routes hit (2) whether we should log both cached routes hit and cached routes miss There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. makes sense - lets chat |
||
|
||
metric.putMetric( | ||
`V2RoutesFetched_Chain_${this.chainId}`, | ||
_(routesWithQuotes).sum() | ||
); | ||
|
||
const routesWithValidQuotes = []; | ||
|
||
for (const routeWithQuote of routesWithQuotes) { | ||
|
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.
number of routes with quotes should just be
routesWithQuotes.length
?