arblang 0.1.24

Visualize and modify Unix pipelines: pipe a stream in, arb spawns a dynamic TUI
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# docker — container CPU/memory dashboard from live docker stats
#   docker stats --no-stream | arb -p docker
bars .containers
source .containers { in; reject /^CONTAINER/; field 2; tally }

gauge .running -max 100
source .running { in; reject /^CONTAINER/; count }

test "container name tally" {
  given "CONTAINER ID   NAME   CPU %" "abc123 web 0.5%" "def456 db 0.3%"
  run { in; reject /^CONTAINER/; field 2; tally }
  want "db\t1" "web\t1"
}
test "running count" {
  given "CONTAINER ID   NAME   CPU %" "abc123 web 0.5%" "def456 db 0.3%"
  run { in; reject /^CONTAINER/; count }
  want "2"
}