mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-02-16 14:57:54 +00:00
remove baseline yeahstack
This commit is contained in:
parent
6becf37c00
commit
21b67179a4
@ -1,6 +1,7 @@
|
|||||||
import std/[macros]
|
import std/[macros]
|
||||||
|
|
||||||
var globalYeahStack* {.global, threadvar.}: seq[string]
|
var globalYeahStack* {.global, threadvar.}: seq[string]
|
||||||
|
var globalBaselineYeahStack* {.global, threadvar.}: seq[string]
|
||||||
var globalYeahInt {.global, threadvar.}: int
|
var globalYeahInt {.global, threadvar.}: int
|
||||||
|
|
||||||
macro asyncyeah*(functionlike: untyped{nkProcDef | nkMethodDef | nkFuncDef}): untyped =
|
macro asyncyeah*(functionlike: untyped{nkProcDef | nkMethodDef | nkFuncDef}): untyped =
|
||||||
|
@ -83,6 +83,13 @@ proc discoveryQueueLoop(b: DiscoveryEngine) {.asyncyeah.} =
|
|||||||
proc heartbeatLoop(b: DiscoveryEngine) {.asyncyeah.} =
|
proc heartbeatLoop(b: DiscoveryEngine) {.asyncyeah.} =
|
||||||
while b.discEngineRunning:
|
while b.discEngineRunning:
|
||||||
await sleepAsync(1.seconds)
|
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.} =
|
proc advertiseQueueLoop*(b: DiscoveryEngine) {.asyncyeah.} =
|
||||||
while b.discEngineRunning:
|
while b.discEngineRunning:
|
||||||
|
@ -342,9 +342,10 @@ proc initRestApi*(node: CodexNodeRef, conf: CodexConf, loopMeasure: LoopMeasure)
|
|||||||
when defined(chronosDurationThreshold):
|
when defined(chronosDurationThreshold):
|
||||||
var breaches = newSeq[string]()
|
var breaches = newSeq[string]()
|
||||||
proc onBreach(durationUs: int64) =
|
proc onBreach(durationUs: int64) =
|
||||||
var trace = ""
|
var trace = "trace: "
|
||||||
for entry in globalYeahStack:
|
for entry in globalYeahStack:
|
||||||
trace = trace & " -> " & entry
|
if globalBaselineYeahStack.find(entry) == -1:
|
||||||
|
trace = trace & " -> " & entry
|
||||||
|
|
||||||
error "Duration threshold breached", durationUs, trace
|
error "Duration threshold breached", durationUs, trace
|
||||||
breaches.add($durationUs & " usecs: " & trace)
|
breaches.add($durationUs & " usecs: " & trace)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user