From 6aec1931f5b8e46eb3bee6971c1cb0bdef2fc4b0 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 12 Mar 2005 04:12:47 +0000 Subject: [PATCH] tcp queue metrics --- src/os/solaris/solaris_sigar.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/os/solaris/solaris_sigar.c b/src/os/solaris/solaris_sigar.c index 6bcbe9ba..9e774aa4 100644 --- a/src/os/solaris/solaris_sigar.c +++ b/src/os/solaris/solaris_sigar.c @@ -1809,6 +1809,8 @@ static void ip_format(char *buffer, IpAddress addr) sprintf(buffer, "%d.%d.%d.%d", ap[0], ap[1], ap[2], ap[3]); } +#define TCPQ_SIZE(s) ((s) >= 0 ? (s) : 0) + static int tcp_connection_list_get(sigar_t *sigar, sigar_net_connection_list_t *connlist, int flags, @@ -1833,6 +1835,12 @@ static int tcp_connection_list_get(sigar_t *sigar, conn->local_port = entry->tcpConnLocalPort; conn->remote_port = entry->tcpConnRemPort; conn->type = SIGAR_NETCONN_TCP; + conn->send_queue = + TCPQ_SIZE(entry->tcpConnEntryInfo.ce_snxt - + entry->tcpConnEntryInfo.ce_suna - 1); + conn->receive_queue = + TCPQ_SIZE(entry->tcpConnEntryInfo.ce_rnxt - + entry->tcpConnEntryInfo.ce_rack); switch (state) { case TCPS_CLOSED: