Copyright | (c) José A. Romero L. |
---|---|
License | BSD3-style (see LICENSE) |
Maintainer | José A. Romero L. <escherdragon@gmail.com> |
Stability | unstable |
Portability | unportable |
Safe Haskell | None |
Language | Haskell2010 |
Provides information about network traffic over selected interfaces,
obtained from parsing the /proc/net/dev
file using some of the
facilities provided by the System.Taffybar.Information.StreamInfo module.
Synopsis
- networkInfoFile :: FilePath
- getNetInfo :: String -> IO (Maybe [Int])
- parseDevNet' :: String -> [(String, [Int])]
- parseDevNet :: String -> [(String, (Int, Int))]
- getDeviceUpDown :: [String] -> Maybe (String, (Int, Int))
- isInterfaceUp :: String -> MaybeT IO ()
- handleFailure :: IO a -> MaybeT IO a
- getDeviceSamples :: IO (Maybe [TxSample])
- data TxSample = TxSample {
- sampleUp :: Int
- sampleDown :: Int
- sampleTime :: SystemTime
- sampleDevice :: String
- monitorNetworkInterfaces :: RealFrac a1 => a1 -> ([(String, (Rational, Rational))] -> IO ()) -> IO ()
- updateSamples :: [(String, (TxSample, TxSample))] -> IO [(String, (TxSample, TxSample))]
- getSpeed :: TxSample -> TxSample -> (Rational, Rational)
- sumSpeeds :: [(Rational, Rational)] -> (Rational, Rational)
Documentation
getNetInfo :: String -> IO (Maybe [Int]) Source #
Returns a two-element list containing the current number of bytes received
and transmitted via the given network interface (e.g. "wlan0"), according
to the contents of the /proc/dev/net
file.
TxSample | |
|