Package org.hyperic.sigar

Examples of org.hyperic.sigar.ProcStat


    }

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

        ProcStat stat = sigar.getProcStat();

        long[] pids = sigar.getProcList();

        assertTrue(stat.getTotal() > 1);
        traceln(stat.toString());
        SigarProxy proxy = SigarProxyCache.newInstance(getSigar());
        traceln(CurrentProcessSummary.get(proxy).toString());
    }
View Full Code Here


  private List<DataEntity> buildProcessInfo() {
    ArrayList<DataEntity> entities = new ArrayList<DataEntity>();

    try {
      ProcStat procStat = m_sigar.getProcStat();
      double totalProc = procStat.getTotal();
      double totalRunning = procStat.getRunning();
      Map<String, Double> values = new HashMap<String, Double>();

      values.put(buildSystemId("totalProcess"), totalProc);
      values.put(buildSystemId("runningProcess"), totalRunning);
      entities.addAll(buildEntities(values, AVG_TYPE));
View Full Code Here

    }

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

        ProcStat stat = sigar.getProcStat();

        long[] pids = sigar.getProcList();

        assertTrue(stat.getTotal() > 1);
        traceln(stat.toString());
        SigarProxy proxy = SigarProxyCache.newInstance(getSigar());
        traceln(CurrentProcessSummary.get(proxy).toString());
    }
View Full Code Here

    }

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

        ProcStat stat = sigar.getProcStat();

        long[] pids = sigar.getProcList();

        //oh-no a racing condition!
        //possible for this test to fail under normal
        //conditions if the process table changes in between.
        //if this is a real problem, can just change to:
        //assertTrue(stat.getTotal() > 1);
        assertTrue(pids.length == stat.getTotal());
        traceln(stat.toString());
        SigarProxy proxy = SigarProxyCache.newInstance(getSigar());
        traceln(CurrentProcessSummary.get(proxy).toString());
    }
View Full Code Here

TOP

Related Classes of org.hyperic.sigar.ProcStat

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.