private void outputTcpStats() throws SigarException { Tcp stat = this.sigar.getTcp(); final String dnt = " "; println(dnt + stat.getActiveOpens() + " active connections openings"); println(dnt + stat.getPassiveOpens() + " passive connection openings"); println(dnt + stat.getAttemptFails() + " failed connection attempts"); println(dnt + stat.getEstabResets() + " connection resets received"); println(dnt + stat.getCurrEstab() + " connections established"); println(dnt + stat.getInSegs() + " segments received"); println(dnt + stat.getOutSegs() + " segments send out"); println(dnt + stat.getRetransSegs() + " segments retransmited"); println(dnt + stat.getInErrs() + " bad segments received."); println(dnt + stat.getOutRsts() + " resets sent"); }
@Override public float poll() { return fixLongValue( sigarWrapper.tcp.getRetransSegs() ); } };
@Override public float poll() { return fixLongValue( sigarWrapper.tcp.getInErrs() ); } };
@Override public float poll() { return fixLongValue( sigarWrapper.tcp.getActiveOpens() ); } };
@Override public float poll() { return fixLongValue( sigarWrapper.tcp.getOutRsts() ); } };
@Override public float poll() { return fixLongValue( sigarWrapper.tcp.getAttemptFails() ); } };
@Override public float poll() { return fixLongValue( sigarWrapper.tcp.getEstabResets() ); } };
@Override public float poll() { return fixLongValue( sigarWrapper.tcp.getInSegs() ); } };
@Override public float poll() { return fixLongValue( sigarWrapper.tcp.getOutSegs() ); } };
@Override public float poll() { return fixLongValue( sigarWrapper.tcp.getPassiveOpens() ); } };
@Override public float poll() { return fixLongValue( sigarWrapper.tcp.getCurrEstab() ); } };
public long getVal() throws StatUnreachableException { try { long curr = sigar.getTcp().getRetransSegs(); long rtn = curr - last; last = curr; if (isFirst) { isFirst = false; throw new StatUnreachableException("don't return first value"); } return rtn; } catch (SigarException e) { throw new StatUnreachableException(e.getMessage(), e); } } });
public long getVal() throws StatUnreachableException { try { long curr = sigar.getTcp().getInErrs(); long rtn = curr - last; last = curr; return rtn; } catch (SigarException e) { throw new StatUnreachableException(e.getMessage(), e); } } });
long currEstab = tcp.getCurrEstab();
final Map<String, Long> stats = diff.to( "tcp", ImmutableMap.<String, Long>builder() .put("sys/tcp/activeOpens", tcp.getActiveOpens()) .put("sys/tcp/passiveOpens", tcp.getPassiveOpens()) .put("sys/tcp/attemptFails", tcp.getAttemptFails()) .put("sys/tcp/estabResets", tcp.getEstabResets()) .put("sys/tcp/in/segs", tcp.getInSegs()) .put("sys/tcp/in/errs", tcp.getInErrs()) .put("sys/tcp/out/segs", tcp.getOutSegs()) .put("sys/tcp/out/rsts", tcp.getOutRsts()) .put("sys/tcp/retrans/segs", tcp.getRetransSegs()) .build() );
final Tcp tcp = sigar.getTcp(); tcpStats = NetworkStats.TcpStats.create( tcp.getActiveOpens(), tcp.getPassiveOpens(), tcp.getAttemptFails(), tcp.getEstabResets(), tcp.getCurrEstab(), tcp.getInSegs(), tcp.getOutSegs(), tcp.getRetransSegs(), tcp.getInErrs(), tcp.getOutRsts()); } catch (SigarException e) { tcpStats = null;
final Map<String, Long> stats = diff.to( "tcp", ImmutableMap.<String, Long>builder() .put("sys/tcp/activeOpens", tcp.getActiveOpens()) .put("sys/tcp/passiveOpens", tcp.getPassiveOpens()) .put("sys/tcp/attemptFails", tcp.getAttemptFails()) .put("sys/tcp/estabResets", tcp.getEstabResets()) .put("sys/tcp/in/segs", tcp.getInSegs()) .put("sys/tcp/in/errs", tcp.getInErrs()) .put("sys/tcp/out/segs", tcp.getOutSegs()) .put("sys/tcp/out/rsts", tcp.getOutRsts()) .put("sys/tcp/retrans/segs", tcp.getRetransSegs()) .build() );
final Map<String, Long> stats = diff.to( "tcp", ImmutableMap.<String, Long>builder() .put("sys/tcp/activeOpens", tcp.getActiveOpens()) .put("sys/tcp/passiveOpens", tcp.getPassiveOpens()) .put("sys/tcp/attemptFails", tcp.getAttemptFails()) .put("sys/tcp/estabResets", tcp.getEstabResets()) .put("sys/tcp/in/segs", tcp.getInSegs()) .put("sys/tcp/in/errs", tcp.getInErrs()) .put("sys/tcp/out/segs", tcp.getOutSegs()) .put("sys/tcp/out/rsts", tcp.getOutRsts()) .put("sys/tcp/retrans/segs", tcp.getRetransSegs()) .build() );
final Map<String, Long> stats = diff.to( "tcp", ImmutableMap.<String, Long>builder() .put("sys/tcp/activeOpens", tcp.getActiveOpens()) .put("sys/tcp/passiveOpens", tcp.getPassiveOpens()) .put("sys/tcp/attemptFails", tcp.getAttemptFails()) .put("sys/tcp/estabResets", tcp.getEstabResets()) .put("sys/tcp/in/segs", tcp.getInSegs()) .put("sys/tcp/in/errs", tcp.getInErrs()) .put("sys/tcp/out/segs", tcp.getOutSegs()) .put("sys/tcp/out/rsts", tcp.getOutRsts()) .put("sys/tcp/retrans/segs", tcp.getRetransSegs()) .build() );
final Map<String, Long> stats = diff.to( "tcp", ImmutableMap.<String, Long>builder() .put("sys/tcp/activeOpens", tcp.getActiveOpens()) .put("sys/tcp/passiveOpens", tcp.getPassiveOpens()) .put("sys/tcp/attemptFails", tcp.getAttemptFails()) .put("sys/tcp/estabResets", tcp.getEstabResets()) .put("sys/tcp/in/segs", tcp.getInSegs()) .put("sys/tcp/in/errs", tcp.getInErrs()) .put("sys/tcp/out/segs", tcp.getOutSegs()) .put("sys/tcp/out/rsts", tcp.getOutRsts()) .put("sys/tcp/retrans/segs", tcp.getRetransSegs()) .build() );