remove baseline yeahstack
This commit is contained in:
parent
6becf37c00
commit
21b67179a4
|
@ -1,6 +1,7 @@
|
|||
import std/[macros]
|
||||
|
||||
var globalYeahStack* {.global, threadvar.}: seq[string]
|
||||
var globalBaselineYeahStack* {.global, threadvar.}: seq[string]
|
||||
var globalYeahInt {.global, threadvar.}: int
|
||||
|
||||
macro asyncyeah*(functionlike: untyped{nkProcDef | nkMethodDef | nkFuncDef}): untyped =
|
||||
|
|
|
@ -83,6 +83,13 @@ proc discoveryQueueLoop(b: DiscoveryEngine) {.asyncyeah.} =
|
|||
proc heartbeatLoop(b: DiscoveryEngine) {.asyncyeah.} =
|
||||
while b.discEngineRunning:
|
||||
await sleepAsync(1.seconds)
|
||||
await sleepAsync(1.seconds)
|
||||
await sleepAsync(1.seconds)
|
||||
await sleepAsync(1.seconds)
|
||||
await sleepAsync(1.seconds)
|
||||
if globalBaselineYeahStack.len == 0:
|
||||
for entry in globalYeahStack:
|
||||
globalBaselineYeahStack.add(entry)
|
||||
|
||||
proc advertiseQueueLoop*(b: DiscoveryEngine) {.asyncyeah.} =
|
||||
while b.discEngineRunning:
|
||||
|
|
|
@ -342,8 +342,9 @@ proc initRestApi*(node: CodexNodeRef, conf: CodexConf, loopMeasure: LoopMeasure)
|
|||
when defined(chronosDurationThreshold):
|
||||
var breaches = newSeq[string]()
|
||||
proc onBreach(durationUs: int64) =
|
||||
var trace = ""
|
||||
var trace = "trace: "
|
||||
for entry in globalYeahStack:
|
||||
if globalBaselineYeahStack.find(entry) == -1:
|
||||
trace = trace & " -> " & entry
|
||||
|
||||
error "Duration threshold breached", durationUs, trace
|
||||
|
|
Loading…
Reference in New Issue