Skip to content

Commit

Permalink
nim 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
inv2004 committed Oct 6, 2024
1 parent 2c08f7b commit f0bc9c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
17 changes: 12 additions & 5 deletions src/ttop/procfs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ proc parseUptime(): uint =
let line = readLines(file, 1)[0]
var f: float
doAssert scanf(line, "$f", f)
uint(float(hz) * f)
return uint(float(hz) * f)

proc parseSize(str: string): uint =
let normStr = str.strip(true, false)
Expand Down Expand Up @@ -618,10 +618,17 @@ proc group*(pidsInfo: PidsTable, kernel: bool): PidsTable =
inc i

when isMainModule:
let fi = fullInfo()
for _, pi in fi.pidsInfo:
if "firefox" in pi.cmd:
echo pi.pid, ": ", pi.name, " --- ", pi.cmd
template t(body: untyped) =
try:
body
except CatchableError, Defect:
raise getCurrentException()

proc f(): int =
t:
100

echo f()
# let pi = group(fi.pidsInfo)
# fi.pidsInfo.clear()
# for o, pi in pi:
Expand Down
4 changes: 2 additions & 2 deletions ttop.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "1.5.0"
version = "1.5.2"
author = "inv2004"
description = "Monitoring tool with historical snapshots and alerts"
license = "MIT"
Expand All @@ -9,7 +9,7 @@ bin = @["ttop"]

# Dependencies

requires "nim >= 1.6.10"
requires "nim >= 2.0.10"

requires "https://github.com/inv2004/illwill"
requires "zippy"
Expand Down

0 comments on commit f0bc9c5

Please sign in to comment.