1 # Civetweb API Reference
3 ### `mg_get_connection_info( ctx, idx, buffer, buflen );`
7 | Parameter | Type | Description |
9 |**`ctx`**|`struct mg_context *`|The server context handle|
10 |**`idx`**|`int`|Connection index within the context|
11 |**`buffer**|`char *`|A string buffer to store the information|
12 |**`buflen**|`int`|Size of the string buffer (including space for a terminating 0)|
16 | Type | Description |
18 |`int`|Available context information in bytes (excluding the terminating 0)|
22 The function `mg_get_connection_info()` returns statistics information collected for
23 a server connection index. This may be empty if the server has not been built with
24 statistics support (`#define USE_SERVER_STATS`).
25 If data is available, the returned string is in JSON format. The exact content may
26 vary, depending on the connection state and server version.
30 This is an experimental interface and may be changed, replaced
31 or even removed in the future. Currently the index `idx` must be
32 between `0` and `num_threads-1`. The thread is not locked for
33 performance reasons, so the information may be inconsistent
38 * [`mg_get_system_info();`](mg_get_system_info.md)
39 * [`mg_get_context_info();`](mg_get_context_info.md)