-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A library for accessing the /proc filesystem in Linux -- -- A library for accessing the /proc filesystem in Linux @package system-linux-proc @version 0.1.1 module System.Linux.Proc.Errors data ProcError ProcReadError :: !FilePath -> !Text -> ProcError ProcParseError :: !FilePath -> !Text -> ProcError ProcMemInfoKeyError :: !Text -> ProcError renderProcError :: ProcError -> Text instance GHC.Show.Show System.Linux.Proc.Errors.ProcError instance GHC.Classes.Eq System.Linux.Proc.Errors.ProcError module System.Linux.Proc.IO listProcDirectory :: FilePath -> ExceptT ProcError IO [FilePath] readProcFile :: FilePath -> ExceptT ProcError IO ByteString module System.Linux.Proc.MemInfo -- | A struct to contain information parsed from the `/proc/meminfo` file -- (Linux only AFAIK). Fields that are listed as being in kilobytes in -- the proc filesystem are converted to bytes. Not all versions of the -- Linux kernel make all the fields in this struct available in which -- case they will be assigned a value of zero. data MemInfo MemInfo :: !Word64 -> !Word64 -> !Word64 -> !Word64 -> !Word64 -> !Word64 -> MemInfo -- | Total physical RAM. [memTotal] :: MemInfo -> !Word64 -- | Total free RAM (which includes memory used for filesystem caching). [memFree] :: MemInfo -> !Word64 -- | Available memory. [memAvailable] :: MemInfo -> !Word64 -- | Amount of RAM used for file buffers. [memBuffers] :: MemInfo -> !Word64 -- | Total about of swap space. [memSwapTotal] :: MemInfo -> !Word64 -- | Amount of swap space that is free. [memSwapFree] :: MemInfo -> !Word64 -- | Read the `/proc/meminfo` file (Linux only AFAIK) and return a -- MemInfo structure. Although this is in IO all exceptions -- and errors should be caught and returned as a ProcError. readProcMemInfo :: IO (Either ProcError MemInfo) -- | Read the value for the given key from `/proc/meminfo`. Although this -- is in IO all exceptions and errors should be caught and -- returned as a ProcError. readProcMemInfoKey :: ByteString -> IO (Either ProcError Word64) -- | Read `/proc/meminfo` file and return a value calculated from: -- -- MemAvailable / MemTotal -- -- Although this is in IO all exceptions and errors should be -- caught and returned as a ProcError. readProcMemUsage :: IO (Either ProcError Double) -- | Render a Word64 as an easy to read size with a bytes, kB, MB, GB TB or -- PB suffix. renderSizeBytes :: Word64 -> Text instance GHC.Show.Show System.Linux.Proc.MemInfo.MemInfo instance GHC.Classes.Eq System.Linux.Proc.MemInfo.MemInfo module System.Linux.Proc.Process newtype ProcessId ProcessId :: Int -> ProcessId [unProcessId] :: ProcessId -> Int -- | Get the current list of ProcessIds. getProcProcessIds :: IO (Either ProcError [ProcessId]) instance GHC.Show.Show System.Linux.Proc.Process.ProcessId instance GHC.Classes.Eq System.Linux.Proc.Process.ProcessId module System.Linux.Proc.Tcp -- | TCP socket used by a process according to the -- `/proc/<pid>/net/tcp` file of the process. Only non-debug fields -- are parsed and described the socket data structure. data TcpSocket TcpSocket :: !(ByteString, Int) -> !(ByteString, Int) -> !TcpState -> !Int -> !Int -> TcpSocket [tcpLocalAddr] :: TcpSocket -> !(ByteString, Int) [tcpRemoteAddr] :: TcpSocket -> !(ByteString, Int) [tcpTcpState] :: TcpSocket -> !TcpState [tcpUid] :: TcpSocket -> !Int [tcpInode] :: TcpSocket -> !Int data TcpState TcpEstablished :: TcpState TcpSynSent :: TcpState TcpSynReceive :: TcpState TcpFinWait1 :: TcpState TcpFinWait2 :: TcpState TcpTimeWait :: TcpState TcpClose :: TcpState TcpCloseWait :: TcpState TcpLastAck :: TcpState TcpListen :: TcpState TcpClosing :: TcpState TcpNewSynReceive :: TcpState -- | Read and parse the `/proc/<pid>/net/tcp` file. Read and parse -- errors are caught and returned. readProcTcpSockets :: ProcessId -> IO (Either ProcError [TcpSocket]) instance GHC.Show.Show System.Linux.Proc.Tcp.TcpSocket instance GHC.Classes.Eq System.Linux.Proc.Tcp.TcpState instance GHC.Show.Show System.Linux.Proc.Tcp.TcpState module System.Linux.Proc