Safe Haskell | None |
---|
procstat
data collector.
Synopsis
- defaultFile :: FilePath
- bufferSize :: Int
- windowSize :: Integer
- defaultCharNum :: Int
- dcName :: String
- dcVersion :: DCVersion
- dcFormatVersion :: Int
- dcCategory :: Maybe DCCategory
- dcKind :: DCKind
- dcReport :: Maybe CollectorData -> IO DCReport
- type Buffer = Seq (ClockTime, [Int])
- computeLoad :: CPUstat -> Int
- dcCollectFromFile :: FilePath -> IO (ClockTime, [Int])
- dcCollect :: IO Buffer
- formatData :: [Double] -> CPUavgload
- updateEntry :: Buffer -> Buffer -> Buffer
- dcUpdate :: Maybe CollectorData -> IO CollectorData
- computeAverage :: Buffer -> Integer -> Integer -> Result [Double]
- buildJsonReport :: Buffer -> IO JSValue
- buildDCReport :: Buffer -> IO DCReport
Documentation
defaultFile :: FilePath Source #
The default path of the CPU status file. It is hardcoded because it is not likely to change.
bufferSize :: Int Source #
The buffer size of the values kept in the map.
windowSize :: Integer Source #
The window size of the values that will export the average load.
defaultCharNum :: Int Source #
The default setting for the maximum amount of not parsed character to print in case of error. It is set to use most of the screen estate on a standard 80x25 terminal. TODO: add the possibility to set this with a command line parameter.
dcFormatVersion :: Int Source #
The version number for the data format of this data collector.
dcCategory :: Maybe DCCategory Source #
The category of this data collector.
dcReport :: Maybe CollectorData -> IO DCReport Source #
The data exported by the data collector, taken from the default location.
computeLoad :: CPUstat -> Int Source #
Compute the load from a CPU.
dcCollectFromFile :: FilePath -> IO (ClockTime, [Int]) Source #
Reads and Computes the load for each CPU.
formatData :: [Double] -> CPUavgload Source #
Formats data for JSON transformation.
dcUpdate :: Maybe CollectorData -> IO CollectorData Source #
Updates the given Collector data.
computeAverage :: Buffer -> Integer -> Integer -> Result [Double] Source #
Computes the average load for every CPU and the overall from data read from the map. Returns Bad if there are not enough values to compute it.
buildJsonReport :: Buffer -> IO JSValue Source #
This function computes the JSON representation of the CPU load.
buildDCReport :: Buffer -> IO DCReport Source #
This function computes the DCReport for the CPU load.