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

fix(market-updater): Fix timing stats #2728

Merged
merged 1 commit into from
Feb 25, 2025
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
8 changes: 7 additions & 1 deletion indexer/services/roundtable/src/tasks/market-updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export function getPriceChange(
}

export default async function runTask(): Promise<void> {
const start: number = Date.now();

const liquidityTiers:
LiquidityTiersFromDatabase[] = await LiquidityTiersTable.findAll({}, []);
const perpetualMarkets:
Expand All @@ -56,7 +58,11 @@ export default async function runTask(): Promise<void> {
const latestPrices: PriceMap = await OraclePriceTable.getLatestPrices();
const prices24hAgo: PriceMap = await OraclePriceTable.getPricesFrom24hAgo();

const start: number = Date.now();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be before initial queries

stats.timing(
`${config.SERVICE_NAME}.market_updater_initial_queries`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Measure initial queries specifically

Date.now() - start,
);

try {
const [
perpetualMarketStats,
Expand Down