Skip to content

Commit

Permalink
feat: add debug command to log hiro limiter data
Browse files Browse the repository at this point in the history
  • Loading branch information
alter-eggo committed Jul 15, 2024
1 parent 69a4e0c commit 52a0c15
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/debug.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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);
Expand Down

0 comments on commit 52a0c15

Please sign in to comment.