diff --git a/blockchain-watcher/config/mainnet.json b/blockchain-watcher/config/mainnet.json index 66f2031b..9cde4a30 100644 --- a/blockchain-watcher/config/mainnet.json +++ b/blockchain-watcher/config/mainnet.json @@ -112,7 +112,7 @@ }, "sui": { "network": "mainnet", - "rpcs": ["https://fullnode.mainnet.sui.io:443", "http://m-sui-01.nodes.stable.io:8546"] + "rpcs": ["https://fullnode.mainnet.sui.io:443"] }, "aptos": { "network": "mainnet", diff --git a/blockchain-watcher/src/domain/actions/aptos/PollAptos.ts b/blockchain-watcher/src/domain/actions/aptos/PollAptos.ts index 77c21e66..16924869 100644 --- a/blockchain-watcher/src/domain/actions/aptos/PollAptos.ts +++ b/blockchain-watcher/src/domain/actions/aptos/PollAptos.ts @@ -91,15 +91,26 @@ export class PollAptos extends RunPollingJob { chain: "aptos", commitment: this.cfg.getCommitment(), }; + const lastFrom = this.lastFrom ?? 0n; + const previousFrom = this.previousFrom ?? 0n; + const diffCursor = BigInt(lastFrom) - BigInt(previousFrom); + this.statsRepo.count("job_execution", labels); - this.statsRepo.measure("polling_cursor", this.lastFrom ?? 0n, { + + this.statsRepo.measure("polling_cursor", lastFrom, { ...labels, type: "max", }); - this.statsRepo.measure("polling_cursor", this.previousFrom ?? 0n, { + + this.statsRepo.measure("polling_cursor", previousFrom, { ...labels, type: "current", }); + + this.statsRepo.measure("polling_cursor", diffCursor, { + ...labels, + type: "diff", + }); } } diff --git a/blockchain-watcher/src/domain/actions/evm/PollEvm.ts b/blockchain-watcher/src/domain/actions/evm/PollEvm.ts index 8f81b807..32f0a5ac 100644 --- a/blockchain-watcher/src/domain/actions/evm/PollEvm.ts +++ b/blockchain-watcher/src/domain/actions/evm/PollEvm.ts @@ -129,15 +129,26 @@ export class PollEvm extends RunPollingJob { chain: this.cfg.chain ?? "", commitment: this.cfg.getCommitment(), }; + const latestBlockHeight = this.latestBlockHeight ?? 0n; + const blockHeightCursor = this.blockHeightCursor ?? 0n; + const diffCursor = BigInt(latestBlockHeight) - BigInt(blockHeightCursor); + this.statsRepo.count("job_execution", labels); - this.statsRepo.measure("polling_cursor", this.latestBlockHeight ?? 0n, { + + this.statsRepo.measure("polling_cursor", latestBlockHeight, { ...labels, type: "max", }); - this.statsRepo.measure("polling_cursor", this.blockHeightCursor ?? 0n, { + + this.statsRepo.measure("polling_cursor", blockHeightCursor, { ...labels, type: "current", }); + + this.statsRepo.measure("polling_cursor", diffCursor, { + ...labels, + type: "diff", + }); } } diff --git a/blockchain-watcher/src/domain/actions/solana/PollSolanaTransactions.ts b/blockchain-watcher/src/domain/actions/solana/PollSolanaTransactions.ts index b216a09f..064cb137 100644 --- a/blockchain-watcher/src/domain/actions/solana/PollSolanaTransactions.ts +++ b/blockchain-watcher/src/domain/actions/solana/PollSolanaTransactions.ts @@ -134,15 +134,26 @@ export class PollSolanaTransactions extends RunPollingJob { chain: "solana", commitment: this.cfg.commitment, }; + const latestSlot = BigInt(this.latestSlot ?? 0); + const slotCursor = BigInt(this.slotCursor ?? 0); + const diffCursor = latestSlot - slotCursor; + this.statsRepo.count("job_execution", labels); - this.statsRepo.measure("polling_cursor", BigInt(this.latestSlot ?? 0), { + + this.statsRepo.measure("polling_cursor", latestSlot, { ...labels, type: "max", }); - this.statsRepo.measure("polling_cursor", BigInt(this.slotCursor ?? 0n), { + + this.statsRepo.measure("polling_cursor", slotCursor, { ...labels, type: "current", }); + + this.statsRepo.measure("polling_cursor", BigInt(diffCursor), { + ...labels, + type: "diff", + }); } /** diff --git a/blockchain-watcher/src/domain/actions/sui/PollSuiTransactions.ts b/blockchain-watcher/src/domain/actions/sui/PollSuiTransactions.ts index 53e48b3e..61293527 100644 --- a/blockchain-watcher/src/domain/actions/sui/PollSuiTransactions.ts +++ b/blockchain-watcher/src/domain/actions/sui/PollSuiTransactions.ts @@ -110,15 +110,26 @@ export class PollSuiTransactions extends RunPollingJob { chain: "sui", commitment: "immediate", }; + const checkpoint = BigInt(this.cursor?.checkpoint ?? 0); + const currentCheckpoint = BigInt(this.currentCheckpoint ?? 0); + const diffCursor = checkpoint - currentCheckpoint; + this.statsRepo.count("job_execution", labels); - this.statsRepo.measure("polling_cursor", BigInt(this.cursor?.checkpoint ?? 0), { + + this.statsRepo.measure("polling_cursor", checkpoint, { ...labels, type: "max", }); - this.statsRepo.measure("polling_cursor", BigInt(this.currentCheckpoint ?? 0n), { + + this.statsRepo.measure("polling_cursor", currentCheckpoint, { ...labels, type: "current", }); + + this.statsRepo.measure("polling_cursor", BigInt(diffCursor), { + ...labels, + type: "diff", + }); } } diff --git a/blockchain-watcher/src/domain/actions/wormchain/PollWormchain.ts b/blockchain-watcher/src/domain/actions/wormchain/PollWormchain.ts index 1e2528e7..752bca96 100644 --- a/blockchain-watcher/src/domain/actions/wormchain/PollWormchain.ts +++ b/blockchain-watcher/src/domain/actions/wormchain/PollWormchain.ts @@ -114,15 +114,26 @@ export class PollWormchain extends RunPollingJob { chain: this.cfg.chain ?? "", commitment: this.cfg.getCommitment(), }; + const latestBlockHeight = this.latestBlockHeight ?? 0n; + const blockHeightCursor = this.blockHeightCursor ?? 0n; + const diffCursor = latestBlockHeight - blockHeightCursor; + this.statsRepo.count("job_execution", labels); - this.statsRepo.measure("polling_cursor", this.latestBlockHeight ?? 0n, { + + this.statsRepo.measure("polling_cursor", latestBlockHeight, { ...labels, type: "max", }); - this.statsRepo.measure("polling_cursor", this.blockHeightCursor ?? 0n, { + + this.statsRepo.measure("polling_cursor", blockHeightCursor, { ...labels, type: "current", }); + + this.statsRepo.measure("polling_cursor", diffCursor, { + ...labels, + type: "diff", + }); } }