TCP/TLS connection pooling for Eio
1(*---------------------------------------------------------------------------
2 Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
3 SPDX-License-Identifier: ISC
4 ---------------------------------------------------------------------------*)
5
6(** Statistics for connection pool endpoints *)
7
8(** {1 Type} *)
9
10type t
11(** Statistics snapshot for a specific endpoint *)
12
13(** {1 Construction} *)
14
15val make :
16 active:int ->
17 idle:int ->
18 total_created:int ->
19 total_reused:int ->
20 total_closed:int ->
21 errors:int ->
22 t
23(** Create a statistics snapshot. *)
24
25(** {1 Accessors} *)
26
27val active : t -> int
28(** Number of connections currently in use. *)
29
30val idle : t -> int
31(** Number of connections in pool waiting to be reused. *)
32
33val total_created : t -> int
34(** Total connections created over the endpoint's lifetime. *)
35
36val total_reused : t -> int
37(** Total number of times connections were reused from the pool. *)
38
39val total_closed : t -> int
40(** Total connections that have been closed. *)
41
42val errors : t -> int
43(** Total connection errors encountered. *)
44
45(** {1 Pretty-printing} *)
46
47val pp : t Fmt.t
48(** Pretty-printer for statistics. *)