Package org.hyperic.sigar

Examples of org.hyperic.sigar.ProcTime


    public static List getInfo(SigarProxy sigar, long pid)
        throws SigarException {

        ProcState state = sigar.getProcState(pid);
        ProcTime time = null;
        String unknown = "???";

        List info = new ArrayList();
        info.add(String.valueOf(pid));

        try {
            ProcCredName cred = sigar.getProcCredName(pid);
            info.add(cred.getUser());
        } catch (SigarException e) {
            info.add(unknown);
        }

        try {
            time = sigar.getProcTime(pid);
            info.add(getStartTime(time.getStartTime()));
        } catch (SigarException e) {
            info.add(unknown);
        }

        try {
View Full Code Here


    private ProcessObject getProcessInfo(SigarProxy sigar, long pid)
            throws SigarException {

        ProcessObject pObj = new ProcessObject(pid);
        ProcState state = sigar.getProcState(pid);
        ProcTime time = null;

        pObj.setPid(pid);

        // get process credential
        try {
            ProcCredName cred = sigar.getProcCredName(pid);
            pObj.setprocessCredentialName(cred.getUser());
        } catch (SigarException e) {
        }

        // get process time
        try {
            time = sigar.getProcTime(pid);
            pObj.setProcessTime(getStartTime(time.getStartTime()));
        } catch (SigarException e) {
        }

        // get process memory related information
        try {
View Full Code Here

    public static List getInfo(SigarProxy sigar, long pid)
        throws SigarException {

        ProcState state = sigar.getProcState(pid);
        ProcTime time = null;
        String unknown = "???";

        List info = new ArrayList();
        info.add(String.valueOf(pid));

        try {
            ProcCredName cred = sigar.getProcCredName(pid);
            info.add(cred.getUser());
        } catch (SigarException e) {
            info.add(unknown);
        }

        try {
            time = sigar.getProcTime(pid);
            info.add(getStartTime(time.getStartTime()));
        } catch (SigarException e) {
            info.add(unknown);
        }

        try {
View Full Code Here

TOP

Related Classes of org.hyperic.sigar.ProcTime

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.