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)
|
||||
if `type` == "static":
|
||||
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"
|
||||
else:
|
||||
exec "nim c" & " --out:build/" & name &
|
||||
".so --threads:on --app:lib --opt:size --noMain --mm:refc --header " & extra_params &
|
||||
" " & srcDir & name & ".nim"
|
||||
".so --threads:on --app:lib --opt:size --noMain --mm:refc --header --undef:metrics " &
|
||||
extra_params & " " & srcDir & name & ".nim"
|
||||
|
||||
proc buildMobileAndroid(srcDir = ".", params = "") =
|
||||
let cpu = getEnv("CPU")
|
||||
|
|
|
@ -18,7 +18,9 @@ proc nowInUnixFloat(): float =
|
|||
proc getNowInNanosecondTime*(): Timestamp =
|
||||
return getNanosecondTime(nowInUnixFloat())
|
||||
|
||||
template nanosecondTime*(collector: Summary | Histogram, body: untyped) =
|
||||
template nanosecondTime*(
|
||||
collector: Summary | Histogram | typedesc[IgnoredCollector], body: untyped
|
||||
) =
|
||||
when defined(metrics):
|
||||
let start = nowInUnixFloat()
|
||||
body
|
||||
|
|
|
@ -80,9 +80,11 @@ proc getRlnMetricsLogger*(): RLNMetricsLogger =
|
|||
var cumulativeValidMessages = 0.float64
|
||||
var cumulativeProofs = 0.float64
|
||||
|
||||
when defined(metrics):
|
||||
logMetrics = proc() =
|
||||
{.gcsafe.}:
|
||||
let freshErrorCount = parseAndAccumulate(waku_rln_errors_total, cumulativeErrors)
|
||||
let freshErrorCount =
|
||||
parseAndAccumulate(waku_rln_errors_total, cumulativeErrors)
|
||||
let freshMsgCount =
|
||||
parseAndAccumulate(waku_rln_messages_total, cumulativeMessages)
|
||||
let freshSpamCount =
|
||||
|
|
Loading…
Reference in New Issue