Skip to content

Commit da5e177

Browse files
authored
integrate rbench
1 parent 306e8ff commit da5e177

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Diff for: ruptime

+15-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,21 @@ done)
9595
u=$(printf "%-28s %s\n" "$k" "$biosdate $cores $mem" | mcrypt -f "$KEY" -Fq | base64 -w0)
9696
;;
9797
rbench)
98-
u=$(printf "%-28s %s\n" "$k" "`/usr/lib/ruptime/benchmark`" | mcrypt -f "$KEY" -Fq | base64 -w0)
98+
dt=date
99+
which gdate >/dev/null && dt=$(which gdate)
100+
which free >/dev/null && m=$(free -b |grep ^Mem: |awk '{printf "%.0f\n", $2/1024/1024/1024}')
101+
which free >/dev/null || m=$(sysctl -n hw.memsize|awk '{printf "%.0f\n", $1/1024/1024/1024}')
102+
start=$($dt +%s.%N)
103+
memtester 16M 1 &>/dev/null
104+
end=$($dt +%s.%N)
105+
mem=$(printf "MEM %.2f %s GB" $(echo $end - $start | bc) $m)
106+
arch=$(uname -m)
107+
cores=$(getconf _NPROCESSORS_ONLN)
108+
start2=$($dt +%s.%N)
109+
/bin/echo "scale=3000;4*a(1)" | bc -l &>/dev/null
110+
end2=$($dt +%s.%N)
111+
cpu=$(printf "CPU %.2f %s\n" $(echo $end2 - $start2 | bc) $cores)
112+
u=$(printf "%-28s %s\n" "$k" "$mem $cpu" | mcrypt -f "$KEY" -Fq | base64 -w0)
99113
;;
100114
rboot)
101115
r=0

0 commit comments

Comments
 (0)