Skip to content

Commit

Permalink
rss smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
inv2004 committed Apr 1, 2024
1 parent 94aca7d commit 77c0cfd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/ttop/format.nim
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ when isMainModule:
echo "|", 8512.formatS, "|"
echo "|", 80512.formatS, "|"
echo "|", 2000512.formatS, "|"
echo "|", 20000512.formatS, "|"
echo "|", 200000512.formatS, "|"
echo "|", 2000000512.formatS, "|"
echo "|", 20000000512.formatS, "|"
echo "|", 200000000512.formatS, "|"
echo "|", 2000000000512.formatS, "|"
echo "|", formatS(3156216320.uint, 12400328704.uint), "|"
echo "|", formatS(156216320.uint, 12400328704.uint), "|"
echo "|", formatS(320.uint, 12400328704.uint), "|"
4 changes: 2 additions & 2 deletions src/ttop/tui.nim
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ proc table(tui: Tui, tb: var TerminalBuffer, pi: OrderedTableRef[uint, PidInfo],
tb.write fmt""" {"CNT":>6}"""
tb.write styleDim, fmt""" {"USER":<8}"""
if tui.sort == Mem: tb.write resetStyle else: tb.write styleDim
tb.write fmt""" {"RSS":>10} {"MEM%":>5}"""
tb.write fmt""" {"RSS":>9} {"MEM%":>5}"""
if tui.sort == Cpu: tb.write resetStyle else: tb.write styleDim
tb.write fmt""" {"CPU%":>5}"""
if tui.sort == IO: tb.write resetStyle else: tb.write styleDim
Expand Down Expand Up @@ -327,7 +327,7 @@ proc table(tui: Tui, tb: var TerminalBuffer, pi: OrderedTableRef[uint, PidInfo],
tb.write " ", fgCyan, p.user.cut(8, false, tui.scrollX), fgColor
if p.mem >= rssLimit:
tb.write bgRed
tb.write " ", p.rss.formatS().cut(10, true, tui.scrollX), bgNone
tb.write " ", p.rss.formatS().cut(9, true, tui.scrollX), bgNone
if p.mem >= rssLimit:
tb.write bgRed
tb.write " ", p.mem.formatP().cut(5, true, tui.scrollX), bgNone
Expand Down
2 changes: 1 addition & 1 deletion ttop.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "1.4.3"
version = "1.4.4"
author = "inv2004"
description = "Monitoring tool with historical snapshots and alerts"
license = "MIT"
Expand Down

0 comments on commit 77c0cfd

Please sign in to comment.