diff --git a/src/core/metrics.ts b/src/core/metrics.ts index d1683f4..6b102f7 100644 --- a/src/core/metrics.ts +++ b/src/core/metrics.ts @@ -132,10 +132,6 @@ const cacheHitCounter = meter.createCounter(METRIC_TYPES.cache_hit_count, { description: 'Total redis cache hits', }); -const cacheMissCounter = meter.createCounter(METRIC_TYPES.cache_miss_count, { - description: 'Total redis cache misses', -}); - const accountUpdatesCounter = meter.createCounter( METRIC_TYPES.account_updates_count, { @@ -249,5 +245,4 @@ export { setLastReceivedWsMsgTs, accountUpdatesCounter, cacheHitCounter, - cacheMissCounter, }; diff --git a/src/index.ts b/src/index.ts index 02db2bd..8dd51f0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -39,7 +39,6 @@ import { accountUpdatesCounter, cacheHitCounter, setLastReceivedWsMsgTs, - cacheMissCounter, } from './core/metrics'; import { handleResponseTime } from './core/middleware'; import { @@ -813,7 +812,9 @@ const main = async () => { } if (l2Formatted) { - cacheHitCounter.add(1); + cacheHitCounter.add(1, { + miss: false, + }); res.writeHead(200); res.end(l2Formatted); return; @@ -871,7 +872,9 @@ const main = async () => { ); } } - cacheMissCounter.add(1); + cacheHitCounter.add(1, { + miss: true, + }); res.writeHead(200); res.end(JSON.stringify(l2Formatted)); } catch (err) { @@ -993,7 +996,9 @@ const main = async () => { } if (l2Formatted) { - cacheHitCounter.add(1); + cacheHitCounter.add(1, { + miss: false, + }); return l2Formatted; } } @@ -1052,7 +1057,9 @@ const main = async () => { ); } } - cacheMissCounter.add(1); + cacheHitCounter.add(1, { + miss: true, + }); return l2Formatted; }) ); diff --git a/src/publishers/dlobPublisher.ts b/src/publishers/dlobPublisher.ts index b6049e6..5209823 100644 --- a/src/publishers/dlobPublisher.ts +++ b/src/publishers/dlobPublisher.ts @@ -149,6 +149,7 @@ const main = async () => { accountSubscription = { type: 'websocket', commitment: stateCommitment, + resubTimeoutMs: 30_000, }; slotSubscriber = new SlotSubscriber(connection); await slotSubscriber.subscribe();