Package org.hyperic.sigar

Examples of org.hyperic.sigar.Tcp


        return address + ":" + port;
    }

    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");
    }
View Full Code Here


    }

    private TCPStatObject getTCPStat() {
        TCPStatObject tcpObj = new TCPStatObject();
        try {
            Tcp stat = sigar.getTcp();
            tcpObj.setActiveOpens(stat.getActiveOpens());
            tcpObj.setPassiveOpens(stat.getPassiveOpens());
            tcpObj.setAttemptFails(stat.getAttemptFails());
            tcpObj.setEstabResets(stat.getEstabResets());
            tcpObj.setCurrentEstab(stat.getCurrEstab());
            tcpObj.setInSegs(stat.getInSegs());
            tcpObj.setOutSegs(stat.getOutSegs());
            tcpObj.setRetransSegs(stat.getRetransSegs());
            tcpObj.setInErrs(stat.getInErrs());
            tcpObj.setOutRsts(stat.getOutRsts());
        } catch (SigarException ex) {
            Logger.getLogger(NetStat.class.getName()).log(Level.SEVERE, null, ex);
        }

        return tcpObj;
View Full Code Here

        super(name);
    }

    public void testCreate() throws Exception {
        Sigar sigar = getSigar();
        Tcp tcp;
       
        try {
            tcp = sigar.getTcp();
        } catch (SigarNotImplementedException e) {
            return;
        } catch (SigarPermissionDeniedException e) {
            return;
        }

        traceln("");
        assertValidFieldTrace("ActiveOpens", tcp.getActiveOpens());
        assertValidFieldTrace("PassiveOpens", tcp.getPassiveOpens());
        assertValidFieldTrace("AttemptFails", tcp.getAttemptFails());
        assertValidFieldTrace("EstabResets", tcp.getEstabResets());
        assertValidFieldTrace("CurrEstab", tcp.getCurrEstab());
        assertValidFieldTrace("InSegs", tcp.getInSegs());
        assertValidFieldTrace("OutSegs", tcp.getOutSegs());
        assertValidFieldTrace("RetransSegs", tcp.getRetransSegs());
        assertValidFieldTrace("OutRsts", tcp.getOutRsts());
    }
View Full Code Here

        super(name);
    }

    public void testCreate() throws Exception {
        Sigar sigar = getSigar();
        Tcp tcp;
       
        try {
            tcp = sigar.getTcp();
        } catch (SigarNotImplementedException e) {
            return;
        } catch (SigarPermissionDeniedException e) {
            return;
        }

        traceln("");
        assertValidFieldTrace("ActiveOpens", tcp.getActiveOpens());
        assertValidFieldTrace("PassiveOpens", tcp.getPassiveOpens());
        assertValidFieldTrace("AttemptFails", tcp.getAttemptFails());
        assertValidFieldTrace("EstabResets", tcp.getEstabResets());
        assertValidFieldTrace("CurrEstab", tcp.getCurrEstab());
        assertValidFieldTrace("InSegs", tcp.getInSegs());
        assertValidFieldTrace("OutSegs", tcp.getOutSegs());
        assertValidFieldTrace("RetransSegs", tcp.getRetransSegs());
        assertValidFieldTrace("OutRsts", tcp.getOutRsts());
    }
View Full Code Here

        return address + ":" + port;
    }

    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");
    }
View Full Code Here

        super(name);
    }

    public void testCreate() throws Exception {
        Sigar sigar = getSigar();
        Tcp tcp;
       
        try {
            tcp = sigar.getTcp();
        } catch (SigarNotImplementedException e) {
            return;
        }

        traceln("");
        assertGtEqZeroTrace("ActiveOpens", tcp.getActiveOpens());
        assertGtEqZeroTrace("PassiveOpens", tcp.getPassiveOpens());
        assertGtEqZeroTrace("AttemptFails", tcp.getAttemptFails());
        assertGtEqZeroTrace("EstabResets", tcp.getEstabResets());
        assertGtEqZeroTrace("CurrEstab", tcp.getCurrEstab());
        assertGtEqZeroTrace("InSegs", tcp.getInSegs());
        assertGtEqZeroTrace("OutSegs", tcp.getOutSegs());
        assertGtEqZeroTrace("RetransSegs", tcp.getRetransSegs());
        assertGtEqZeroTrace("OutRsts", tcp.getOutRsts());
    }
View Full Code Here

TOP

Related Classes of org.hyperic.sigar.Tcp

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.