.put("sys/tcp/state/closing", (long) netStat.getTcpClosing()) .put("sys/tcp/state/idle", (long) netStat.getTcpIdle()) .put("sys/tcp/state/bound", (long) netStat.getTcpBound()) .build(); for (Map.Entry<String, Long> entry : stats.entrySet()) {
@Override public float poll() { return fixLongValue( sigarWrapper.netstat.getTcpBound() ); } };
private static Map<String, String> toMap(NetStat netStat) { Map<String, String> result = Maps.newHashMap(); result.put("allInboundTotal", "" + netStat.getAllInboundTotal()); result.put("allOutboundTotal", "" + netStat.getAllOutboundTotal()); result.put("tcpBound", "" + netStat.getTcpBound()); result.put("tcpClose", "" + netStat.getTcpClose()); result.put("tcpCloseWait", "" + netStat.getTcpCloseWait()); result.put("tcpClosing", "" + netStat.getTcpClosing()); result.put("tcpEstablished", "" + netStat.getTcpEstablished()); result.put("tcpFinWait1", "" + netStat.getTcpFinWait1()); result.put("tcpFinWait2", "" + netStat.getTcpFinWait2()); result.put("tcpIdle", "" + netStat.getTcpIdle()); result.put("tcpInboundTotal", "" + netStat.getTcpInboundTotal()); result.put("tcpLastAck", "" + netStat.getTcpLastAck()); result.put("tcpListen", "" + netStat.getTcpListen()); result.put("tcpOutboundTotal", "" + netStat.getTcpOutboundTotal()); result.put("tcpStates", "" + netStat.getTcpStates()); result.put("tcpSynRecv", "" + netStat.getTcpSynRecv()); result.put("tcpSynSent", "" + netStat.getTcpSynSent()); result.put("tcpTimeWait", "" + netStat.getTcpTimeWait()); return result; }
.put("sys/tcp/state/closing", (long) netStat.getTcpClosing()) .put("sys/tcp/state/idle", (long) netStat.getTcpIdle()) .put("sys/tcp/state/bound", (long) netStat.getTcpBound()) .build(); for (Map.Entry<String, Long> entry : stats.entrySet()) {
.put("sys/tcp/state/closing", (long) netStat.getTcpClosing()) .put("sys/tcp/state/idle", (long) netStat.getTcpIdle()) .put("sys/tcp/state/bound", (long) netStat.getTcpBound()) .build(); for (Map.Entry<String, Long> entry : stats.entrySet()) {
.put("sys/tcp/state/closing", (long) netStat.getTcpClosing()) .put("sys/tcp/state/idle", (long) netStat.getTcpIdle()) .put("sys/tcp/state/bound", (long) netStat.getTcpBound()) .build(); for (Map.Entry<String, Long> entry : stats.entrySet()) {
.put("sys/tcp/state/closing", (long) netStat.getTcpClosing()) .put("sys/tcp/state/idle", (long) netStat.getTcpIdle()) .put("sys/tcp/state/bound", (long) netStat.getTcpBound()) .build(); for (Map.Entry<String, Long> entry : stats.entrySet()) {
.put("sys/tcp/state/closing", (long) netStat.getTcpClosing()) .put("sys/tcp/state/idle", (long) netStat.getTcpIdle()) .put("sys/tcp/state/bound", (long) netStat.getTcpBound()) .build(); for (Map.Entry<String, Long> entry : stats.entrySet()) {
@Override public TcpData getTcpData() { TcpData data = new TcpData(); try { NetStat stat = sigar.getNetStat(); data.setTcpBound(stat.getTcpBound()); data.setTcpEstablished(stat.getTcpEstablished()); data.setTcpIdle(stat.getTcpIdle()); data.setTcpListen(stat.getTcpListen()); data.setTcpSynchronizedReceived(stat.getTcpSynRecv()); long inboundBytes = 0; long outboundBytes = 0; for(String netInterface : sigar.getNetInterfaceList()) { for(String mask : interfaceNames) { if(netInterface.matches(mask)) { inboundBytes += sigar.getNetInterfaceStat(netInterface).getRxBytes(); outboundBytes += sigar.getNetInterfaceStat(netInterface).getTxBytes(); } } } data.setTcpInboundTotal(inboundBytes); data.setTcpOutboundTotal(outboundBytes); logger.debug("getTcpData: {}", data); } catch (SigarException e) { logger.warn("Exception during getTcpData", e); } return data; }
definitions.add(new Definition("sigar.network.tcp.bound", "TCP Bound", "TCP Bound", "count", () -> sigar.getNetStat().getTcpBound())); definitions.add(new Definition("sigar.network.tcp.close", "TCP Close", "TCP Close", "count",
switch (type) { case BOUND: val = stat.getTcpBound(); break; case CLOSE:
switch (type) { case BOUND: val = stat.getTcpBound(); break; case CLOSE: