chore(rln): remove old and add new rln metric (#1926)

This commit is contained in:
Alvaro Revuelta 2023-08-22 16:30:33 +02:00 committed by GitHub
parent 66ab55a8ef
commit fa716d9b92
3 changed files with 13 additions and 16 deletions

View File

@ -79,6 +79,7 @@ method atomicBatch*(g: OnchainGroupManager,
let operationSuccess = g.rlnInstance.atomicWrite(some(start), idCommitments, toRemoveIndices)
if not operationSuccess:
raise newException(ValueError, "atomic batch operation failed")
waku_rln_number_registered_memberships.inc(int64(idCommitments.len - toRemoveIndices.len))
if g.registerCb.isSome():
var membersSeq = newSeq[Membership]()
@ -421,7 +422,6 @@ method startGroupSync*(g: OnchainGroupManager): Future[void] {.async.} =
g.idCredentials = some(idCredential)
debug "registering commitment on contract"
waku_rln_registration_duration_seconds.nanosecondTime:
await g.register(idCredential)
if g.registrationHandler.isSome():
# We need to callback with the tx hash

View File

@ -35,12 +35,11 @@ declarePublicHistogram(identifier = waku_rln_valid_messages_total,
buckets = generateBucketsForHistogram(AcceptableRootWindowSize))
declarePublicCounter(waku_rln_errors_total, "number of errors detected while operating the rln relay", ["type"])
declarePublicCounter(waku_rln_proof_verification_total, "number of times the rln proofs are verified")
declarePublicCounter(waku_rln_number_registered_memberships, "number of registered and active rln memberships")
# Timing metrics
declarePublicGauge(waku_rln_proof_verification_duration_seconds, "time taken to verify a proof")
declarePublicGauge(waku_rln_relay_mounting_duration_seconds, "time taken to mount the waku rln relay")
declarePublicGauge(waku_rln_proof_generation_duration_seconds, "time taken to generate a proof")
declarePublicGauge(waku_rln_registration_duration_seconds, "time taken to register to a rln membership set")
declarePublicGauge(waku_rln_instance_creation_duration_seconds, "time taken to create an rln instance")
declarePublicGauge(waku_rln_membership_insertion_duration_seconds, "time taken to insert a new member into the local merkle tree")
declarePublicGauge(waku_rln_membership_credentials_import_duration_seconds, "time taken to import membership credentials")

View File

@ -399,9 +399,7 @@ proc new*(T: type WakuRlnRelay,
## Returns an error if the rln-relay protocol could not be mounted.
debug "rln-relay input validation passed"
try:
waku_rln_relay_mounting_duration_seconds.nanosecondTime:
let rlnRelay = await mount(conf,
registrationHandler)
let rlnRelay = await mount(conf, registrationHandler)
return ok(rlnRelay)
except CatchableError as e:
return err(e.msg)