metrics: rename routing_table_nodes to discovery_routing_table_nodes

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2024-10-08 10:23:22 +02:00
parent 6e180af4aa
commit b7b04ed9e4
No known key found for this signature in database
GPG Key ID: 0FE274EE8C95166E

View File

@ -14,7 +14,7 @@ import
export options
declarePublicGauge routing_table_nodes,
declarePublicGauge discovery_routing_table_nodes,
"Discovery routing table nodes", labels = ["state"]
logScope:
@ -208,14 +208,14 @@ proc ipLimitDec(r: var RoutingTable, b: KBucket, n: Node) =
proc add(k: KBucket, n: Node) =
k.nodes.add(n)
routing_table_nodes.inc()
discovery_routing_table_nodes.inc()
proc remove(k: KBucket, n: Node): bool =
let i = k.nodes.find(n)
if i != -1:
routing_table_nodes.dec()
discovery_routing_table_nodes.dec()
if k.nodes[i].seen:
routing_table_nodes.dec(labelValues = ["seen"])
discovery_routing_table_nodes.dec(labelValues = ["seen"])
k.nodes.delete(i)
trace "removed node:", node = n
true
@ -527,7 +527,7 @@ proc setJustSeen*(r: RoutingTable, n: Node) =
if not n.seen:
b.nodes[0].seen = true
routing_table_nodes.inc(labelValues = ["seen"])
discovery_routing_table_nodes.inc(labelValues = ["seen"])
proc nodeToRevalidate*(r: RoutingTable): Node =
## Return a node to revalidate. The least recently seen node from a random