org.hyperic.sigar.ProcStat Maven / Gradle / Ivy
/*****************************************************
* 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;
/**
* ProcStat sigar class.
*/
public class ProcStat implements java.io.Serializable {
private static final long serialVersionUID = 7546L;
public ProcStat() { }
public native void gather(Sigar sigar) throws SigarException;
/**
* This method is not intended to be called directly.
* use Sigar.getProcStat() instead.
* @exception SigarException on failure.
* @see org.hyperic.sigar.Sigar#getProcStat
*/
static ProcStat fetch(Sigar sigar) throws SigarException {
ProcStat procStat = new ProcStat();
procStat.gather(sigar);
return procStat;
}
long total = 0;
/**
* Get the Total number of processes.
* Supported Platforms: All.
*
* System equivalent commands:
* - AIX:
top, ps
* - Darwin:
top, ps
* - FreeBSD:
top, ps
* - HPUX:
top, ps
* - Linux:
top, ps
* - Solaris:
top, ps
* - Win32:
taskman
*
* @return Total number of processes
*/
public long getTotal() { return total; }
long idle = 0;
/**
* Get the Total number of processes in idle state.
* Supported Platforms: All.
*
* System equivalent commands:
* - AIX:
top, ps
* - Darwin:
top, ps
* - FreeBSD:
top, ps
* - HPUX:
top, ps
* - Linux:
top, ps
* - Solaris:
top, ps
* - Win32:
taskman
*
* @return Total number of processes in idle state
*/
public long getIdle() { return idle; }
long running = 0;
/**
* Get the Total number of processes in run state.
* Supported Platforms: All.
*
* System equivalent commands:
* - AIX:
top, ps
* - Darwin:
top, ps
* - FreeBSD:
top, ps
* - HPUX:
top, ps
* - Linux:
top, ps
* - Solaris:
top, ps
* - Win32:
taskman
*
* @return Total number of processes in run state
*/
public long getRunning() { return running; }
long sleeping = 0;
/**
* Get the Total number of processes in sleep state.
* Supported Platforms: All.
*
* System equivalent commands:
* - AIX:
top, ps
* - Darwin:
top, ps
* - FreeBSD:
top, ps
* - HPUX:
top, ps
* - Linux:
top, ps
* - Solaris:
top, ps
* - Win32:
taskman
*
* @return Total number of processes in sleep state
*/
public long getSleeping() { return sleeping; }
long stopped = 0;
/**
* Get the Total number of processes in stop state.
* Supported Platforms: All.
*
* System equivalent commands:
* - AIX:
top, ps
* - Darwin:
top, ps
* - FreeBSD:
top, ps
* - HPUX:
top, ps
* - Linux:
top, ps
* - Solaris:
top, ps
* - Win32:
taskman
*
* @return Total number of processes in stop state
*/
public long getStopped() { return stopped; }
long zombie = 0;
/**
* Get the Total number of processes in zombie state.
* Supported Platforms: All.
*
* System equivalent commands:
* - AIX:
top, ps
* - Darwin:
top, ps
* - FreeBSD:
top, ps
* - HPUX:
top, ps
* - Linux:
top, ps
* - Solaris:
top, ps
* - Win32:
taskman
*
* @return Total number of processes in zombie state
*/
public long getZombie() { return zombie; }
long threads = 0;
/**
* Get the Total number of threads.
* Supported Platforms: All.
*
* System equivalent commands:
* - AIX:
top, ps
* - Darwin:
top, ps
* - FreeBSD:
top, ps
* - HPUX:
top, ps
* - Linux:
top, ps
* - Solaris:
top, ps
* - Win32:
taskman
*
* @return Total number of threads
*/
public long getThreads() { return threads; }
void copyTo(ProcStat copy) {
copy.total = this.total;
copy.idle = this.idle;
copy.running = this.running;
copy.sleeping = this.sleeping;
copy.stopped = this.stopped;
copy.zombie = this.zombie;
copy.threads = this.threads;
}
public Map toMap() {
Map map = new HashMap();
String strtotal =
String.valueOf(this.total);
if (!"-1".equals(strtotal))
map.put("Total", strtotal);
String stridle =
String.valueOf(this.idle);
if (!"-1".equals(stridle))
map.put("Idle", stridle);
String strrunning =
String.valueOf(this.running);
if (!"-1".equals(strrunning))
map.put("Running", strrunning);
String strsleeping =
String.valueOf(this.sleeping);
if (!"-1".equals(strsleeping))
map.put("Sleeping", strsleeping);
String strstopped =
String.valueOf(this.stopped);
if (!"-1".equals(strstopped))
map.put("Stopped", strstopped);
String strzombie =
String.valueOf(this.zombie);
if (!"-1".equals(strzombie))
map.put("Zombie", strzombie);
String strthreads =
String.valueOf(this.threads);
if (!"-1".equals(strthreads))
map.put("Threads", strthreads);
return map;
}
public String toString() {
return toMap().toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy