diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-13 22:52:46 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-13 22:52:46 +0200 |
| commit | cd5a3614baab756a41d764b79308afeea93f12dd (patch) | |
| tree | efc8c31e8b162ca2121ba92c841322119e6d3b04 /internal/constants | |
| parent | bf7c6ade292a6444877797c8d699d147aceb57cc (diff) | |
Remove Perl version and build files; add .gitignore for .serena/
Amp-Thread-ID: https://ampcode.com/threads/T-019c58b3-06fb-733d-8fc1-f268fe7f70d5
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'internal/constants')
| -rw-r--r-- | internal/constants/constants.go | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/internal/constants/constants.go b/internal/constants/constants.go new file mode 100644 index 0000000..44a0478 --- /dev/null +++ b/internal/constants/constants.go @@ -0,0 +1,59 @@ +package constants + +// Paths and limits +const ( + ConfFile = ".loadbarsrc" + CSSHConfFile = "/etc/clusters" + CSSHMaxRecursion = 10 + ColorDepth = 32 + Interval = 0.14 // CPU sampling interval (seconds) + IntervalNet = 3.0 // Network stats interval + IntervalMem = 1.0 // Memory stats interval + IntervalSDL = 0.14 // Display refresh interval + IntervalSDLWarn = 1.0 // Warn if loop is slower than this + SystemBlueThreshold = 30 // CPU system % for lighter blue + UserOrangeThreshold = 70 // CPU user % for orange + UserYellowThreshold = 50 // CPU user % for dark yellow +) + +// Exit codes +const ( + Success = 0 + EUnknown = 1 + ENoHost = 2 +) + +// Copyright string +const Copyright = "2010-2026 (c) Paul Buetow <loadbars@dev.buetow.org>" + +// RGB returns R, G, B in 0-255 for SDL. +type RGB struct{ R, G, B uint8 } + +// Colors used by the display (matching Perl Constants.pm) +var ( + Black = RGB{0x00, 0x00, 0x00} + Blue0 = RGB{0x00, 0x00, 0xff} + LightBlue = RGB{0x00, 0x00, 0xdd} + LightBlue0 = RGB{0x00, 0x00, 0xcc} + Blue = RGB{0x00, 0x00, 0x88} + Green = RGB{0x00, 0x90, 0x00} + LightGreen = RGB{0x00, 0xf0, 0x00} + Orange = RGB{0xff, 0x70, 0x00} + Purple = RGB{0xa0, 0x20, 0xf0} + Red = RGB{0xff, 0x00, 0x00} + White = RGB{0xff, 0xff, 0xff} + Grey0 = RGB{0x11, 0x11, 0x11} + Grey = RGB{0xaa, 0xaa, 0xaa} + DarkGrey = RGB{0x15, 0x15, 0x15} + Yellow0 = RGB{0xff, 0xa0, 0x00} + Yellow = RGB{0xff, 0xc0, 0x00} +) + +// BytesPerSec for link speed reference (bytes per second at given mbit) +var ( + BytesMbit = 125000 + Bytes10Mbit = 1250000 + Bytes100Mbit = 12500000 + BytesGbit = 125000000 + Bytes10Gbit = 1250000000 +) |
