• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2.. _metrics:
3
4Metrics operations
5======================
6
7libuv provides a metrics API to track the amount of time the event loop has
8spent idle in the kernel's event provider.
9
10API
11---
12
13.. c:function:: uint64_t uv_metrics_idle_time(uv_loop_t* loop)
14
15    Retrieve the amount of time the event loop has been idle in the kernel's
16    event provider (e.g. ``epoll_wait``). The call is thread safe.
17
18    The return value is the accumulated time spent idle in the kernel's event
19    provider starting from when the :c:type:`uv_loop_t` was configured to
20    collect the idle time.
21
22    .. note::
23        The event loop will not begin accumulating the event provider's idle
24        time until calling :c:type:`uv_loop_configure` with
25        :c:type:`UV_METRICS_IDLE_TIME`.
26
27    .. versionadded:: 1.39.0
28