remove baseline yeahstack

This commit is contained in:
benbierens 2023-07-13 16:06:16 +02:00
parent 6becf37c00
commit 21b67179a4
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
3 changed files with 11 additions and 2 deletions

View File

@ -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 =

View File

@ -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:

View File

@ -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