TCP/TLS connection pooling for Eio
at main 1.0 kB view raw
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 8type t = { 9 active : int; 10 idle : int; 11 total_created : int; 12 total_reused : int; 13 total_closed : int; 14 errors : int; 15} 16 17let make ~active ~idle ~total_created ~total_reused ~total_closed ~errors = 18 { active; idle; total_created; total_reused; total_closed; errors } 19 20let active t = t.active 21let idle t = t.idle 22let total_created t = t.total_created 23let total_reused t = t.total_reused 24let total_closed t = t.total_closed 25let errors t = t.errors 26 27let pp ppf t = 28 Fmt.pf ppf 29 "@[<v>Stats:@,\ 30 - Active: %d@,\ 31 - Idle: %d@,\ 32 - Created: %d@,\ 33 - Reused: %d@,\ 34 - Closed: %d@,\ 35 - Errors: %d@]" 36 t.active t.idle t.total_created t.total_reused t.total_closed t.errors