All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hyperic.sigar.Uptime Maven / Gradle / Ivy

There is a newer version: 1.6.6-rev002
Show newest version
/*****************************************************
 * WARNING: this file was generated by -e
 * on Mon May 24 16:26:06 2010.
 * Any changes made here will be LOST.
 *****************************************************/
package org.hyperic.sigar;

import java.util.HashMap;
import java.util.Map;

/**
 * Uptime sigar class.
 */
public class Uptime implements java.io.Serializable {

    private static final long serialVersionUID = 1263L;

    public Uptime() { }

    public native void gather(Sigar sigar) throws SigarException;

    /**
     * This method is not intended to be called directly.
     * use Sigar.getUptime() instead.
     * @exception SigarException on failure.
     * @see org.hyperic.sigar.Sigar#getUptime
     */
    static Uptime fetch(Sigar sigar) throws SigarException {
        Uptime uptime = new Uptime();
        uptime.gather(sigar);
        return uptime;
    }

    double uptime = 0;

    /**
     * Get the Time since machine started in seconds.

* Supported Platforms: All. *

* System equivalent commands:

    *
  • AIX: uptime
    *
  • Darwin: uptime
    *
  • FreeBSD: uptime
    *
  • HPUX: uptime
    *
  • Linux: uptime
    *
  • Solaris: uptime
    *
  • Win32:
    *
* @return Time since machine started in seconds */ public double getUptime() { return uptime; } void copyTo(Uptime copy) { copy.uptime = this.uptime; } public Map toMap() { Map map = new HashMap(); String struptime = String.valueOf(this.uptime); if (!"-1".equals(struptime)) map.put("Uptime", struptime); return map; } public String toString() { return toMap().toString(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy