From 03506d3fbe0246093e503c1ed2733a2729c741ff Mon Sep 17 00:00:00 2001 From: Will Liu Date: Tue, 18 Jun 2024 11:32:27 -0400 Subject: [PATCH] rename stats --- .../roundtable/src/tasks/uncross-orderbook.ts | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/indexer/services/roundtable/src/tasks/uncross-orderbook.ts b/indexer/services/roundtable/src/tasks/uncross-orderbook.ts index 355cfe55b8..8ea5024a26 100644 --- a/indexer/services/roundtable/src/tasks/uncross-orderbook.ts +++ b/indexer/services/roundtable/src/tasks/uncross-orderbook.ts @@ -53,7 +53,6 @@ async function uncrossOrderbook( market: PerpetualMarketFromDatabase, orderbookLevels: OrderbookLevels, ): Promise { - console.log(`orderbookLevels: ${JSON.stringify(orderbookLevels)}`); const ticker = market.ticker; // Remove overlapping levels @@ -92,7 +91,7 @@ async function uncrossOrderbook( stats.increment( `${config.SERVICE_NAME}.expected_uncross_orderbook_levels`, removeBidLevels.length, - { side: OrderSide.BUY }, + { side: OrderSide.BUY, clobPairId: market.clobPairId, ticker }, ); for (const bid of removeBidLevels) { const deleted: boolean = await OrderbookLevelsCache.deleteStalePriceLevel({ @@ -119,17 +118,23 @@ async function uncrossOrderbook( ticker, }); } else { - stats.increment(`${config.SERVICE_NAME}.uncross_orderbook`, { side: OrderSide.BUY }); + stats.increment( + `${config.SERVICE_NAME}.uncross_orderbook_succeed`, + { + side: OrderSide.BUY, + clobPairId: market.clobPairId, + ticker, + }, + ); } } stats.increment( `${config.SERVICE_NAME}.expected_uncross_orderbook_levels`, removeAskLevels.length, - { side: OrderSide.SELL }, + { side: OrderSide.SELL, clobPairId: market.clobPairId, ticker }, ); for (const ask of removeAskLevels) { - stats.increment(`${config.SERVICE_NAME}.uncross_orderbook`, { side: OrderSide.SELL }); const deleted: boolean = await OrderbookLevelsCache.deleteStalePriceLevel({ ticker, side: OrderSide.SELL, @@ -154,7 +159,14 @@ async function uncrossOrderbook( ticker, }); } else { - stats.increment(`${config.SERVICE_NAME}.uncross_orderbook`, { side: OrderSide.SELL }); + stats.increment( + `${config.SERVICE_NAME}.uncross_orderbook_succeed`, + { + side: OrderSide.SELL, + clobPairId: market.clobPairId, + ticker, + }, + ); } } }