From 43939e525330a779301eee28cf5d36710ed0cb07 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 27 Jun 2019 12:39:09 +0200 Subject: [esock|doc] Add documentation for the (socket) info function Add documentation for the (socket) info function, which (among other things) return the socket counters. Also typed the return value (socket_info()). OTP-15818 --- erts/preloaded/ebin/socket.beam | Bin 75844 -> 76064 bytes erts/preloaded/src/socket.erl | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'erts/preloaded') diff --git a/erts/preloaded/ebin/socket.beam b/erts/preloaded/ebin/socket.beam index 42959cac4b..25eb0b2f4a 100644 Binary files a/erts/preloaded/ebin/socket.beam and b/erts/preloaded/ebin/socket.beam differ diff --git a/erts/preloaded/src/socket.erl b/erts/preloaded/src/socket.erl index b0f84700a1..be94e3a867 100644 --- a/erts/preloaded/src/socket.erl +++ b/erts/preloaded/src/socket.erl @@ -67,6 +67,10 @@ select_ref/0, select_info/0, + socket_counters/0, + socket_counter/0, + socket_info/0, + %% command/0, domain/0, @@ -153,6 +157,15 @@ }. %% -type command() :: debug_command(). +-type socket_counters() :: [{socket_counter(), non_neg_integer()}]. +-type socket_counter() :: read_byte | read_fails | read_pkg | read_tries | + read_waits | write_byte | write_fails | write_pkg | + write_tries | write_waits. +-type socket_info() :: #{counters := socket_counters(), + num_readers := non_neg_integer(), + num_writers := non_neg_integer(), + num_acceptors := non_neg_integer()}. + -type uint8() :: 0..16#FF. -type uint16() :: 0..16#FFFF. -type uint20() :: 0..16#FFFFF. @@ -912,7 +925,7 @@ command(#{command := debug, %% %% =========================================================================== --spec info(Socket) -> map() when +-spec info(Socket) -> socket_info() when Socket :: socket(). info(#socket{ref = SockRef}) -> -- cgit v1.2.3