mirror of
https://github.com/logos-storage/nim-chronos.git
synced 2026-01-05 23:13:08 +00:00
19 lines
470 B
Nim
19 lines
470 B
Nim
import ./config
|
|
|
|
when chronosProfiling:
|
|
import ./futures
|
|
import ./profiler/metrics
|
|
|
|
export futures, metrics
|
|
|
|
when not chronosFutureId:
|
|
{.error: "chronosProfiling requires chronosFutureId to be enabled".}
|
|
|
|
proc getMetrics*(): ProfilerMetrics =
|
|
## Returns metrics for the current event loop.
|
|
result = metrics.getMetrics()
|
|
|
|
proc enableProfiling*() =
|
|
## Enables profiling on the current event loop.
|
|
onFutureEvent = metrics.handleFutureEvent
|