Skip to content

Commit

Permalink
fix: store txs in dict
Browse files Browse the repository at this point in the history
  • Loading branch information
magicalne committed Sep 23, 2022
1 parent b90e666 commit 7151865
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions agent/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
LastBlockTimestamp = None
BlockTimeDifference = None
TPS = None
CommitTransacionCount = 0
CommitTransacionCount = {}
CustodianStats = None
DepositDict = {}
WithdrawalDict = {}
Expand Down Expand Up @@ -95,7 +95,7 @@ def update_metrics(tip_number, ping, last_block_hash: str,
LastBlockTimestamp = last_block_ts
BlockTimeDifference = block_time_diff
TPS = tps
CommitTransacionCount += tx_cnt
CommitTransacionCount[tip_number] = tx_cnt
DepositDict[tip_number] = deposit
WithdrawalDict[tip_number] = withdrawal

Expand All @@ -108,7 +108,7 @@ def reset_metrics():
global CommitTransacionCount
global DepositDict
global WithdrawalDict
CommitTransacionCount = 0
CommitTransacionCount = {}
DepositDict = {}
WithdrawalDict = {}

Expand Down Expand Up @@ -389,7 +389,7 @@ def exporter(block_number=None):
).set(BlockTimeDifference)

node_BlockDetail_transactions.labels(
gw_rpc_url=gw_rpc_url).set(CommitTransacionCount)
gw_rpc_url=gw_rpc_url).set(sum(CommitTransacionCount.values()))

gw_tps.labels(gw_rpc_url=gw_rpc_url).set(TPS)

Expand Down

0 comments on commit 7151865

Please sign in to comment.