Skip to content

Commit

Permalink
Track filter percent of cached pools (Uniswap#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeki authored May 13, 2024
1 parent cec5918 commit 5c032cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/providers/v2/subgraph-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ export class V2SubgraphProvider implements IV2SubgraphProvider {

metric.putMetric(`V2SubgraphProvider.chain_${this.chainId}.getPools.filter.latency`, Date.now() - beforeFilter);
metric.putMetric(`V2SubgraphProvider.chain_${this.chainId}.getPools.filter.length`, poolsSanitized.length);
metric.putMetric(
`V2SubgraphProvider.chain_${this.chainId}.getPools.filter.percent`,
(poolsSanitized.length / pools.length) * 100
);
metric.putMetric(`V2SubgraphProvider.chain_${this.chainId}.getPools`, 1);
metric.putMetric(`V2SubgraphProvider.chain_${this.chainId}.getPools.latency`, Date.now() - beforeAll);

Expand Down
4 changes: 4 additions & 0 deletions src/providers/v3/subgraph-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ export class V3SubgraphProvider implements IV3SubgraphProvider {

metric.putMetric(`V3SubgraphProvider.chain_${this.chainId}.getPools.filter.latency`, Date.now() - beforeFilter);
metric.putMetric(`V3SubgraphProvider.chain_${this.chainId}.getPools.filter.length`, poolsSanitized.length);
metric.putMetric(
`V3SubgraphProvider.chain_${this.chainId}.getPools.filter.percent`,
(poolsSanitized.length / pools.length) * 100
);
metric.putMetric(`V3SubgraphProvider.chain_${this.chainId}.getPools`, 1);
metric.putMetric(`V3SubgraphProvider.chain_${this.chainId}.getPools.latency`, Date.now() - beforeAll);

Expand Down

0 comments on commit 5c032cc

Please sign in to comment.