Class GetProcData

java.lang.Object
org.deltava.dao.file.DAO
org.deltava.dao.file.GetProcData

public class GetProcData extends DAO
A Data Access Object to read from the Linux /proc filesystem.
Since:
1.0
Version:
9.1
Author:
Luke
  • Constructor Details

    • GetProcData

      public GetProcData()
      Initializes the Data Access Object.
  • Method Details

    • getUptime

      public long getUptime() throws DAOException
      Retrieves system uptime from /proc/uptime.
      Returns:
      the machine's uptime in milliseconds
      Throws:
      DAOException - if an I/O error occurs
    • getLoad

      public List<Double> getLoad() throws DAOException
      Returns the system load average from /proc/loadavg.
      Returns:
      a List of doubles, with processes waiting in the last 1, 5 and 15 minutes
      Throws:
      DAOException - if an I/O error occurs
    • getMemory

      public Map<String,Integer> getMemory() throws DAOException
      Returns system memory data from /proc/meminfo.
      Returns:
      a Map of Integers, keyed by value
      Throws:
      DAOException - if an I/O error occurs