From a9a1293a1fc4f43e885ef2ba55e75aae32b55fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20P=C3=A9rez?= Date: Fri, 19 Jan 2024 15:58:33 +0100 Subject: [PATCH] Token Metrics --- src/tokenMetadataSingleton.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tokenMetadataSingleton.ts b/src/tokenMetadataSingleton.ts index aa202614..5eaf290b 100644 --- a/src/tokenMetadataSingleton.ts +++ b/src/tokenMetadataSingleton.ts @@ -1,6 +1,7 @@ import { CHAIN_ID, CHAIN_NAME_LOWER } from './config'; import { TokenMetadata, TokenRegistry } from './entities'; import { kafkaSendAsync } from './utils'; +import { SAVED_RESULTS } from './utils/metrics'; import { Producer } from 'kafkajs'; import { Connection } from 'typeorm'; @@ -55,6 +56,8 @@ export class TokenMetadataSingleton { this.tokens = this.tokens.concat(newTokenMetadata.map((token) => token.address)); + // Does not exclude "ignored" tokens + SAVED_RESULTS.labels({ type: 'tokens' }).inc(newTokenMetadata.length); kafkaSendAsync(producer, `event-scraper.${CHAIN_NAME_LOWER}.tokens-metadata.v0`, ['address'], newTokenMetadata); } }