fix(rln-relay): waku_rln_number_registered_memberships metrics appropriately handled (#2018)

This commit is contained in:
Aaryamann Challani 2023-09-11 19:21:45 +05:30 committed by GitHub
parent 47ae19c104
commit a4e783303c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -105,7 +105,8 @@ 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))
# TODO: when slashing is enabled, we need to track slashed members
waku_rln_number_registered_memberships.set(int64(start.int + idCommitments.len - toRemoveIndices.len))
if g.registerCb.isSome():
var membersSeq = newSeq[Membership]()

View File

@ -35,7 +35,8 @@ 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")
# this is a gauge so that we can set it based on the events we receive
declarePublicGauge(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")