Skip to content

Commit

Permalink
Token Metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Ktl-XV committed Jan 19, 2024
1 parent 7404190 commit a9a1293
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tokenMetadataSingleton.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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);
}
}

0 comments on commit a9a1293

Please sign in to comment.