From 52a0c15c8919e86b7414309585cedfc3e6b01c81 Mon Sep 17 00:00:00 2001 From: Anastasios Date: Mon, 15 Jul 2024 17:23:33 +0400 Subject: [PATCH] feat: add debug command to log hiro limiter data --- src/app/debug.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/debug.ts b/src/app/debug.ts index 4e27d5a3a3f..9d704fd8eee 100644 --- a/src/app/debug.ts +++ b/src/app/debug.ts @@ -1,5 +1,8 @@ import * as reduxPersist from 'redux-persist'; +import { HIRO_API_BASE_URL_MAINNET } from '@leather.io/models'; +import { getHiroApiRateLimiter } from '@leather.io/query'; + import { logger } from '@shared/logger'; import { getLogsFromBrowserStorage } from '@shared/logger-storage'; import { persistConfig } from '@shared/storage/redux-pesist'; @@ -23,6 +26,15 @@ const debug = { logStore() { return store.getState(); }, + logHiroLimiter(url = HIRO_API_BASE_URL_MAINNET) { + const limiter = getHiroApiRateLimiter(url); + + return { + size: limiter.size, + pending: limiter.pending, + limiter, + }; + }, // Utilised in integration tests async logPersistedStore() { return reduxPersist.getStoredState(persistConfig);