Package org.hyperic.sigar

Examples of org.hyperic.sigar.Sigar


    public TestProcTime(String name) {
        super(name);
    }

    public void testCreate() throws Exception {
        Sigar sigar = getSigar();

        try {
            sigar.getProcTime(getInvalidPid());
        } catch (SigarException e) {
        }

        ProcCpu procTime = sigar.getProcCpu(sigar.getPid());

        assertGtEqZeroTrace("StartTime", procTime.getStartTime());
        traceln("StartDate=" + new Date(procTime.getStartTime()));
        //XXX
        //assertTrue(procTime.getStartTime() < System.currentTimeMillis());
View Full Code Here


            //ok
        }
    }

    public void testCreate() throws Exception {
        Sigar sigar = getSigar();

        try {
      printModules(sigar, getInvalidPid());
        } catch (SigarException e) {
        }

        try {
      printModules(sigar, sigar.getPid());
        } catch (SigarNotImplementedException e) {
            return;
        }

  long[] pids = sigar.getProcList();

  for (int i=0; i<pids.length; i++) {
            try {
                printModules(sigar, pids[i]);
            } catch (SigarException e) {
View Full Code Here

    public TestNfsServerV2(String name) {
        super(name);
    }

    public void testCreate() throws Exception {
        Sigar sigar = getSigar();
        NfsServerV2 nfs;
       
        try {
            nfs = sigar.getNfsServerV2();
        } catch (SigarException e) {
            return;
        }

        traceMethods(nfs);
View Full Code Here

        SigarException ex;
        //true should make things blow up
        boolean useGlobal = false;

        public void run() {
            Sigar sigar;
            SigarProxy proxy;

            try {
                synchronized (lock) {
                    if (useGlobal) {
                        if (gSigar == null) {

                            gSigar = new Sigar();

                            gProxy = SigarProxyCache.newInstance(gSigar, 30 * 1000);
                        }

                        sigar = gSigar;
                        proxy = gProxy;
                    }
                    else {
                        sigar = new Sigar();
                   
                        proxy = SigarProxyCache.newInstance(sigar, 30 * 1000);
                    }
                }

View Full Code Here

    public TestMem(String name) {
        super(name);
    }

    public void testCreate() throws Exception {
        Sigar sigar = getSigar();

        Mem mem = sigar.getMem();

        assertGtZeroTrace("Total", mem.getTotal());

        assertGtZeroTrace("Used", mem.getUsed());
View Full Code Here

    public TestTcpStat(String name) {
        super(name);
    }

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

            throw e;
        }
    }

    public void testValidQueries() throws Exception {
        Sigar sigar = getSigar();

        assertTrue(THIS_PROCESS,
                   runQuery(sigar, THIS_PROCESS) == 1);

        int numProcs = runQuery(sigar, JAVA_PROCESS);
View Full Code Here

        }
        this.qf.clear();
    }

    public void testSelf() throws Exception {
        Sigar sigar = getSigar();

        //should have eaten some cpu during this test
        String q = "Cpu.Percent.ge=0.01";
        ProcessQuery status = this.qf.getQuery(q);
        long pid = sigar.getPid();
        traceln(q + "=" + status.match(sigar, pid));
    }
View Full Code Here

    public TestNfsClientV2(String name) {
        super(name);
    }

    public void testCreate() throws Exception {
        Sigar sigar = getSigar();
        NfsClientV2 nfs;
       
        try {
            nfs = sigar.getNfsClientV2();
        } catch (SigarException e) {
            return;
        }

        traceMethods(nfs);
View Full Code Here

        //assertTrue(procMem.getSize() > 0);
        // XXX vsize, resident, share, rss
    }

    public void testCreate() throws Exception {
        Sigar sigar = getSigar();

        try {
            sigar.getProcMem(getInvalidPid());
        } catch (SigarException e) {
        }

        long[] pids = sigar.getProcList();
        for (int i=0; i<pids.length; i++) {
            traceMem(sigar, pids[i]);
        }
    }
View Full Code Here

TOP

Related Classes of org.hyperic.sigar.Sigar

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.