enable/stop -> attach/detach

This commit is contained in:
gmega 2024-03-01 14:22:19 -03:00
parent b972187054
commit a732b55488
No known key found for this signature in database
GPG Key ID: FFD8DAF00660270F
3 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,7 @@ proc enableProfiling*(callback: EventCallback = nil) =
## Enables profiling for the the event loop running in the current thread.
## The client may optionally supply a callback to be notified of `Future`
## events.
enableMonitoring(
attachMonitoring(
if (isNil(callback)):
proc(e: Event) {.nimcall.} =
profilerInstance.processEvent(e)

View File

@ -58,7 +58,7 @@ proc handleAsyncFutureEvent*(
if not isNil(handleFutureEvent):
handleFutureEvent(mkEvent(future, extendedState))
proc enableMonitoring*(callback: EventCallback) =
proc attachMonitoring*(callback: EventCallback) =
## Enables monitoring of Chronos `Future` state transitions on the
## event loop that runs in the current thread. The provided callback will be
## called at every such event.
@ -66,7 +66,7 @@ proc enableMonitoring*(callback: EventCallback) =
onAsyncFutureEvent = handleAsyncFutureEvent
handleFutureEvent = callback
proc stopMonitoring*() =
proc detachMonitoring*() =
onBaseFutureEvent = nil
onAsyncFutureEvent = nil
handleFutureEvent = nil

View File

@ -30,11 +30,11 @@ proc recordSegment*(segment: string) =
proc stopRecording*(): void =
recording = @[]
rawRecording = @[]
stopMonitoring()
detachMonitoring()
proc startRecording*() =
stopRecording()
enableMonitoring(recordEvent)
attachMonitoring(recordEvent)
proc forProc*(self: var MetricsTotals, procedure: string): AggregateMetrics =
for (key, aggMetrics) in self.mpairs: