Debian Codegraph @

Externals/watcher/watcher/tool/show/sysres

raw symbols SCIP
1 #! /usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 WATCHER_PID=$(pgrepscip-shell system . . pgrep. wtr.watcher || echoscip-shell system . . echo. false)
4 testscip-shell system . . test. "$WATCHER_PID" = false && {
5 echoscip-shell system . . echo. 'watcher not running.'; exit 1; }
6
7 TIME_SPAN=5
8 testscip-shell system . . test. $# -eq 1 \
9 && testscip-shell system . . test. $1 -gt 0 \
10 && TIME_SPAN=$1
11
12 RESULT="$( \
13 top \
14 -pid $WATCHER_PID \
15 -s $TIME_SPAN \
16 -l 2 \
17 -c a \
18 -stats cpu,mem \
19 | tail -n 1)"
20
21 echoscip-shell system . . echo. "time span: ${TIME_SPAN}s"
22 echoscip-shell system . . echo. "$RESULT" | sedscip-shell system . . sed. -E 's/(.+)( +)(.+)/cpu usage: \1\nmemory usage: \3/g'