Home Explore Blog CI



neovim

58th chunk of `runtime/doc/luvref.txt`
f3762b3f60824e15f4107d659cb399653a17fffcf3344ea4000000010000098c
        *uv.translate_sys_error()*

                Parameters:
                - `errcode`: `integer`

                Returns the libuv error message and error name (both in string
                form, see `err` and `name` in |luv-error-handling|) equivalent
                to the given platform dependent error code: POSIX error codes
                on Unix (the ones stored in errno), and Win32 error codes on
                Windows (those returned by GetLastError() or
                WSAGetLastError()).

                Returns: `string, string` or `nil`

==============================================================================
METRICS OPERATIONS                                      *luv-metrics-operations*

uv.metrics_idle_time()                                  *uv.metrics_idle_time()*

                Retrieve the amount of time the event loop has been idle in
                the kernel’s event provider (e.g. `epoll_wait`). The call is
                thread safe.

                The return value is the accumulated time spent idle in the
                kernel’s event provider starting from when the |uv_loop_t| was
                configured to collect the idle time.

                Note: The event loop will not begin accumulating the event
                provider’s idle time until calling `loop_configure` with
                `"metrics_idle_time"`.

                Returns: `number`

uv.metrics_info()                                            *uv.metrics_info()*

                Get the metrics table from current set of event loop metrics.
                It is recommended to retrieve these metrics in a `prepare`
                callback (see |uv.new_prepare()|, |uv.prepare_start()|) in order
                to make sure there are no inconsistencies with the metrics
                counters.

                Returns: `table`

                - `loop_count` : `integer`
                - `events` : `integer`
                - `events_waiting` : `integer`

==============================================================================
STRING MANIPULATION FUNCTIONS                          *luv-string-manipulation*

These string utilities are needed internally for dealing with Windows, and are
exported to allow clients to work uniformly with this data when the libuv API
is not complete.

Notes:
1. New in luv version 1.49.0.
2. See the WTF-8 spec (https://simonsapin.github.io/wtf-8/)

Title: Libuv: Metrics Operations and String Manipulation Utilities
Summary
This section describes libuv's metrics operations, specifically `uv.metrics_idle_time()` for retrieving event loop idle time and `uv.metrics_info()` for accessing a table of event loop metrics. It also introduces string manipulation utilities added in luv 1.49.0 for handling Windows strings, referencing the WTF-8 specification.