Age | Commit message (Collapse) | Author |
|
It's possible (and happens) that netParser sees a device that is no
longer there when we get to isUp. This happens almost every time I
resume from suspend and the WWAN card (USB device) reappears, and
results in xmobar showing the exception until I restart it.
Originally I tried
tryJust (guard . isDoesNotExistError) (B.readFile (operstateDir d))
and it worked for a while but in recent kernels it's possible to open
the file and have the device disappear before we get to reading the
contents of it, so we need to surround the whole open/read block in
catchIOError and make sure it's evaluated.
|
|
|
|
|
|
My laptop currently has rx/tx bytes in 10s of gigabytes and it's only
been up for 20 days. Normally it's several times more. At this point,
Float can only tell the difference of 4KB and up:
Prelude> let x = (50 * 2^30 :: Float) in (x + 2000) - x
0.0
Prelude> let x = (50 * 2^30 :: Float) in (x + 3000) - x
4096.0
This commit makes the Net monitor read Word64 which is exactly what the
kernel prints into /proc/net/dev [1] and converts to Float only after
subtracting the two numbers.
[1] https://github.com/torvalds/linux/blob/7a308bb3016f57e5be11a677d15b821536419d36/net/core/net-procfs.c#L82
Still, I think it's time to switch from Float to Double. At half-gigabit
speeds (easily attainable at home while rsyncing over a direct UTP cable
between two post-2010 laptops), Float can only tell the difference of
8 bytes and up (and I'm not even considering takeDigits!). That's
probably okay for a Net monitor in xmobar, but we're so close to the
limit it makes sense to move to Double just in case.
|
|
|
|
* Batt
* Bright
* Cpu
* Disk
* MPD
* Mem
* MultiCpu
* Net
* Volume
* Wireless
|
|
|
|
|
|
Adaptive units are computed only if suffix is enabled
Otherwise we fall back to the old computation (KB)
|
|
Cf. discussion of issue #98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|