Skip to main content

gvproxy_get_stats

Function gvproxy_get_stats 

Source
pub unsafe extern "C" fn gvproxy_get_stats(
    id: c_longlong,
) -> *mut c_char
Expand description

Get network statistics for a gvproxy instance

Returns a JSON string containing network statistics including:

  • bytes_sent, bytes_received: Total bandwidth
  • tcp.forward_max_inflight_drop: Packets dropped due to maxInFlight limit
  • tcp.current_established: Active TCP connections
  • tcp.failed_connection_attempts: Total connection failures
  • tcp.retransmits: TCP segments retransmitted
  • tcp.timeouts: RTO timeout events

§Arguments

  • id - Instance ID returned from gvproxy_create

§Returns

Pointer to JSON string (must be freed with gvproxy_free_string), or NULL if:

  • Instance doesn’t exist
  • VirtualNetwork not initialized yet
  • Stats collection or serialization failed

§Safety

  • id must be a valid instance ID
  • Returned pointer must be freed with gvproxy_free_string
  • Do not use pointer after calling gvproxy_free_string