chore: fix inconsistent metric naming ()

This commit is contained in:
Vaclav Pavlin 2024-12-12 11:45:47 +01:00 committed by GitHub
parent 0c6784da7e
commit 855b973811
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions
codex/blockexchange/engine

View File

@ -26,7 +26,7 @@ import ../../manifest
logScope: logScope:
topics = "codex discoveryengine advertiser" topics = "codex discoveryengine advertiser"
declareGauge(codexInflightAdvertise, "inflight advertise requests") declareGauge(codex_inflight_advertise, "inflight advertise requests")
const const
DefaultConcurrentAdvertRequests = 10 DefaultConcurrentAdvertRequests = 10
@ -97,12 +97,12 @@ proc processQueueLoop(b: Advertiser) {.async.} =
request = b.discovery.provide(cid) request = b.discovery.provide(cid)
b.inFlightAdvReqs[cid] = request b.inFlightAdvReqs[cid] = request
codexInflightAdvertise.set(b.inFlightAdvReqs.len.int64) codex_inflight_advertise.set(b.inFlightAdvReqs.len.int64)
await request await request
finally: finally:
b.inFlightAdvReqs.del(cid) b.inFlightAdvReqs.del(cid)
codexInflightAdvertise.set(b.inFlightAdvReqs.len.int64) codex_inflight_advertise.set(b.inFlightAdvReqs.len.int64)
except CancelledError: except CancelledError:
trace "Advertise task cancelled" trace "Advertise task cancelled"
return return

View File

@ -31,7 +31,7 @@ import ../../manifest
logScope: logScope:
topics = "codex discoveryengine" topics = "codex discoveryengine"
declareGauge(codexInflightDiscovery, "inflight discovery requests") declareGauge(codex_inflight_discovery, "inflight discovery requests")
const const
DefaultConcurrentDiscRequests = 10 DefaultConcurrentDiscRequests = 10
@ -96,7 +96,7 @@ proc discoveryTaskLoop(b: DiscoveryEngine) {.async.} =
.wait(DefaultDiscoveryTimeout) .wait(DefaultDiscoveryTimeout)
b.inFlightDiscReqs[cid] = request b.inFlightDiscReqs[cid] = request
codexInflightDiscovery.set(b.inFlightDiscReqs.len.int64) codex_inflight_discovery.set(b.inFlightDiscReqs.len.int64)
let let
peers = await request peers = await request
@ -110,7 +110,7 @@ proc discoveryTaskLoop(b: DiscoveryEngine) {.async.} =
finally: finally:
b.inFlightDiscReqs.del(cid) b.inFlightDiscReqs.del(cid)
codexInflightDiscovery.set(b.inFlightDiscReqs.len.int64) codex_inflight_discovery.set(b.inFlightDiscReqs.len.int64)
except CancelledError: except CancelledError:
trace "Discovery task cancelled" trace "Discovery task cancelled"
return return