From 7a440f9727a319bbdf3fc11a924824c65ee24273 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 8 Aug 2007 04:51:12 +0000 Subject: [PATCH] add 'netstat -s' tcp metrics --- .../src/org/hyperic/sigar/cmd/Netstat.java | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/bindings/java/src/org/hyperic/sigar/cmd/Netstat.java b/bindings/java/src/org/hyperic/sigar/cmd/Netstat.java index a739e410..910f7422 100644 --- a/bindings/java/src/org/hyperic/sigar/cmd/Netstat.java +++ b/bindings/java/src/org/hyperic/sigar/cmd/Netstat.java @@ -26,6 +26,7 @@ import org.hyperic.sigar.NetServices; import org.hyperic.sigar.SigarException; import org.hyperic.sigar.NetConnection; import org.hyperic.sigar.NetFlags; +import org.hyperic.sigar.TcpStat; /** * Display network connections. @@ -43,7 +44,7 @@ public class Netstat extends SigarCommandBase { "" }; - private static boolean isNumeric, wantPid; + private static boolean isNumeric, wantPid, isStat; public Netstat(Shell shell) { super(shell); @@ -66,6 +67,7 @@ public class Netstat extends SigarCommandBase { int proto_flags = 0; isNumeric = false; wantPid = false; + isStat = false; for (int i=0; i 0) { flags = getFlags(args, flags); + if (isStat) { + outputStats(flags); + return; + } } NetConnection[] connections = this.sigar.getNetConnectionList(flags);