Package com.jezhumble.javasysmon

Examples of com.jezhumble.javasysmon.JavaSysMon


    return physical().getTotalBytes();
  }
 
  public static double getCpuUsage(long time) throws ApplicationException {
    if(time<1) throw new ApplicationException("time has to be bigger than 0");
    if(jsm==null) jsm=new JavaSysMon();
    CpuTimes cput = jsm.cpuTimes();
    if(cput==null) throw new ApplicationException("CPU information are not available for this OS");
    CpuTimes previous = new CpuTimes(cput.getUserMillis(),cput.getSystemMillis(),cput.getIdleMillis());
        sleep(time);
       
View Full Code Here


        return jsm.cpuTimes().getCpuUsage(previous)*100D;
    }
 

  private synchronized static MemoryStats physical() throws ApplicationException {
    if(jsm==null) jsm=new JavaSysMon();
    MemoryStats p = jsm.physical();
    if(p==null) throw new ApplicationException("Memory information are not available for this OS");
    return p;
  }
View Full Code Here

    /**
     * Creates a new Performance Monitor
     */
    public PerformanceMonitor() {
        monitor = new JavaSysMon();
        if (!monitor.supportedPlatform()) {
            final SpaceBukkit spaceBukkit = SpaceBukkit.getInstance();
            spaceBukkit.getLogger().severe("Performance monitoring unsupported!");
            monitor = null;
        } else
View Full Code Here

TOP

Related Classes of com.jezhumble.javasysmon.JavaSysMon

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.