Rename routing_table_nodes metric for discv4 routing table (#646)

This commit is contained in:
Kim De Mey 2023-10-31 18:28:21 +01:00 committed by GitHub
parent 957d8491af
commit 700360fde2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ import
export results export results
declarePublicGauge routing_table_nodes, declareGauge routing_table_nodes,
"Discovery routing table nodes", labels = ["state"] "Discovery routing table nodes", labels = ["state"]
type type

View File

@ -15,8 +15,8 @@ import
export sets # TODO: This should not be needed, but compilation fails otherwise export sets # TODO: This should not be needed, but compilation fails otherwise
declarePublicGauge routing_table_nodes, declareGauge discv4_routing_table_nodes,
"Discovery routing table nodes" "Discovery v4 routing table nodes"
logScope: logScope:
topics = "eth p2p kademlia" topics = "eth p2p kademlia"
@ -221,7 +221,7 @@ proc add(k: KBucket, n: Node): Node =
k.nodes.add(n) k.nodes.add(n)
elif k.len < BUCKET_SIZE: elif k.len < BUCKET_SIZE:
k.nodes.add(n) k.nodes.add(n)
routing_table_nodes.inc() discv4_routing_table_nodes.inc()
else: else:
k.replacementCache.add(n) k.replacementCache.add(n)
return k.head return k.head
@ -230,7 +230,7 @@ proc add(k: KBucket, n: Node): Node =
proc removeNode(k: KBucket, n: Node) = proc removeNode(k: KBucket, n: Node) =
let i = k.nodes.find(n) let i = k.nodes.find(n)
if i != -1: if i != -1:
routing_table_nodes.dec() discv4_routing_table_nodes.dec()
k.nodes.delete(i) k.nodes.delete(i)
proc split(k: KBucket): tuple[lower, upper: KBucket] = proc split(k: KBucket): tuple[lower, upper: KBucket] =