mirror of https://github.com/waku-org/nwaku.git
chore: disabling metrics for libwaku (#3058)
This commit is contained in:
parent
dd02908a20
commit
b358c90fa5
|
@ -63,12 +63,12 @@ proc buildLibrary(name: string, srcDir = "./", params = "", `type` = "static") =
|
||||||
extra_params &= " " & paramStr(i)
|
extra_params &= " " & paramStr(i)
|
||||||
if `type` == "static":
|
if `type` == "static":
|
||||||
exec "nim c" & " --out:build/" & name &
|
exec "nim c" & " --out:build/" & name &
|
||||||
".a --threads:on --app:staticlib --opt:size --noMain --mm:refc --header " &
|
".a --threads:on --app:staticlib --opt:size --noMain --mm:refc --header --undef:metrics " &
|
||||||
extra_params & " " & srcDir & name & ".nim"
|
extra_params & " " & srcDir & name & ".nim"
|
||||||
else:
|
else:
|
||||||
exec "nim c" & " --out:build/" & name &
|
exec "nim c" & " --out:build/" & name &
|
||||||
".so --threads:on --app:lib --opt:size --noMain --mm:refc --header " & extra_params &
|
".so --threads:on --app:lib --opt:size --noMain --mm:refc --header --undef:metrics " &
|
||||||
" " & srcDir & name & ".nim"
|
extra_params & " " & srcDir & name & ".nim"
|
||||||
|
|
||||||
proc buildMobileAndroid(srcDir = ".", params = "") =
|
proc buildMobileAndroid(srcDir = ".", params = "") =
|
||||||
let cpu = getEnv("CPU")
|
let cpu = getEnv("CPU")
|
||||||
|
|
|
@ -18,7 +18,9 @@ proc nowInUnixFloat(): float =
|
||||||
proc getNowInNanosecondTime*(): Timestamp =
|
proc getNowInNanosecondTime*(): Timestamp =
|
||||||
return getNanosecondTime(nowInUnixFloat())
|
return getNanosecondTime(nowInUnixFloat())
|
||||||
|
|
||||||
template nanosecondTime*(collector: Summary | Histogram, body: untyped) =
|
template nanosecondTime*(
|
||||||
|
collector: Summary | Histogram | typedesc[IgnoredCollector], body: untyped
|
||||||
|
) =
|
||||||
when defined(metrics):
|
when defined(metrics):
|
||||||
let start = nowInUnixFloat()
|
let start = nowInUnixFloat()
|
||||||
body
|
body
|
||||||
|
|
|
@ -80,24 +80,26 @@ proc getRlnMetricsLogger*(): RLNMetricsLogger =
|
||||||
var cumulativeValidMessages = 0.float64
|
var cumulativeValidMessages = 0.float64
|
||||||
var cumulativeProofs = 0.float64
|
var cumulativeProofs = 0.float64
|
||||||
|
|
||||||
logMetrics = proc() =
|
when defined(metrics):
|
||||||
{.gcsafe.}:
|
logMetrics = proc() =
|
||||||
let freshErrorCount = parseAndAccumulate(waku_rln_errors_total, cumulativeErrors)
|
{.gcsafe.}:
|
||||||
let freshMsgCount =
|
let freshErrorCount =
|
||||||
parseAndAccumulate(waku_rln_messages_total, cumulativeMessages)
|
parseAndAccumulate(waku_rln_errors_total, cumulativeErrors)
|
||||||
let freshSpamCount =
|
let freshMsgCount =
|
||||||
parseAndAccumulate(waku_rln_spam_messages_total, cumulativeSpamMessages)
|
parseAndAccumulate(waku_rln_messages_total, cumulativeMessages)
|
||||||
let freshInvalidMsgCount =
|
let freshSpamCount =
|
||||||
parseAndAccumulate(waku_rln_invalid_messages_total, cumulativeInvalidMessages)
|
parseAndAccumulate(waku_rln_spam_messages_total, cumulativeSpamMessages)
|
||||||
let freshValidMsgCount =
|
let freshInvalidMsgCount =
|
||||||
parseAndAccumulate(waku_rln_valid_messages_total, cumulativeValidMessages)
|
parseAndAccumulate(waku_rln_invalid_messages_total, cumulativeInvalidMessages)
|
||||||
let freshProofCount =
|
let freshValidMsgCount =
|
||||||
parseAndAccumulate(waku_rln_proof_verification_total, cumulativeProofs)
|
parseAndAccumulate(waku_rln_valid_messages_total, cumulativeValidMessages)
|
||||||
|
let freshProofCount =
|
||||||
|
parseAndAccumulate(waku_rln_proof_verification_total, cumulativeProofs)
|
||||||
|
|
||||||
info "Total messages", count = freshMsgCount
|
info "Total messages", count = freshMsgCount
|
||||||
info "Total spam messages", count = freshSpamCount
|
info "Total spam messages", count = freshSpamCount
|
||||||
info "Total invalid messages", count = freshInvalidMsgCount
|
info "Total invalid messages", count = freshInvalidMsgCount
|
||||||
info "Total valid messages", count = freshValidMsgCount
|
info "Total valid messages", count = freshValidMsgCount
|
||||||
info "Total errors", count = freshErrorCount
|
info "Total errors", count = freshErrorCount
|
||||||
info "Total proofs verified", count = freshProofCount
|
info "Total proofs verified", count = freshProofCount
|
||||||
return logMetrics
|
return logMetrics
|
||||||
|
|
Loading…
Reference in New Issue