|
@@ -694,16 +694,16 @@ jat__stat() {
|
694
|
694
|
#
|
695
|
695
|
local which=$1
|
696
|
696
|
case $which in
|
697
|
|
- swarc) grep -cxF MESSAGE.WARNING "$(__jat__sd_path "llog")" ;;
|
698
|
|
- pwarc) grep -cxF MESSAGE.WARNING "$(__jat__sd_path "P.llog")" ;;
|
699
|
|
- serrc) grep -cxF MESSAGE.ERROR "$(__jat__sd_path "llog")" ;;
|
700
|
|
- perrc) grep -cxF MESSAGE.ERROR "$(__jat__sd_path "P.llog")" ;;
|
701
|
|
- sfailc) grep -cxF ASSERT.FAIL "$(__jat__sd_path "vlog")" ;;
|
702
|
|
- pfailc) grep -cxF ASSERT.FAIL "$(__jat__sd_path "P.vlog")" ;;
|
703
|
|
- ppassc) grep -cxF ASSERT.PASS "$(__jat__sd_path "P.vlog")" ;;
|
704
|
|
- spassc) grep -cxF ASSERT.PASS "$(__jat__sd_path "vlog")" ;;
|
705
|
|
- pasrtc) grep -cx 'ASSERT.PASS\|ASSERT.FAIL' "$(__jat__sd_path "P.vlog")" ;;
|
706
|
|
- sasrtc) grep -cx 'ASSERT.PASS\|ASSERT.FAIL' "$(__jat__sd_path "vlog")" ;;
|
|
697
|
+ swarc) __jat__statcnt llog MESSAGE.WARNING ;;
|
|
698
|
+ pwarc) __jat__statcnt P.llog MESSAGE.WARNING ;;
|
|
699
|
+ serrc) __jat__statcnt llog MESSAGE.ERROR ;;
|
|
700
|
+ perrc) __jat__statcnt P.llog MESSAGE.ERROR ;;
|
|
701
|
+ sfailc) __jat__statcnt vlog ASSERT.FAIL ;;
|
|
702
|
+ pfailc) __jat__statcnt P.vlog ASSERT.FAIL ;;
|
|
703
|
+ ppassc) __jat__statcnt P.vlog ASSERT.PASS ;;
|
|
704
|
+ spassc) __jat__statcnt vlog ASSERT.PASS ;;
|
|
705
|
+ pasrtc) __jat__statcnt P.vlog ASSERT.PASS ASSERT.FAIL ;;
|
|
706
|
+ sasrtc) __jat__statcnt vlog ASSERT.PASS ASSERT.FAIL ;;
|
707
|
707
|
*) __jat__usage "invalid statistic field: $which"
|
708
|
708
|
return 2 ;;
|
709
|
709
|
esac
|
|
@@ -1270,6 +1270,28 @@ __jat__show_error() {
|
1270
|
1270
|
warn "jat.ERROR" "$1"
|
1271
|
1271
|
}
|
1272
|
1272
|
|
|
1273
|
+__jat__statcnt() {
|
|
1274
|
+ #
|
|
1275
|
+ # Sum up number of lines $2.. in session data key $1
|
|
1276
|
+ #
|
|
1277
|
+ # Print count of lines or 0 if the key is not present at all.
|
|
1278
|
+ #
|
|
1279
|
+ local key=$1; shift
|
|
1280
|
+ local line
|
|
1281
|
+ local sdpath
|
|
1282
|
+ local sum=0
|
|
1283
|
+ local lsum=0
|
|
1284
|
+ sdpath=$(__jat__sd_path "$key")
|
|
1285
|
+ test -f "$sdpath" || { echo 0; return 1; }
|
|
1286
|
+ test -s "$sdpath" || { echo 0; return 1; }
|
|
1287
|
+ for line in "$@"; do
|
|
1288
|
+ lsum=$(grep -cxF "$line" "$sdpath")
|
|
1289
|
+ sum=$((sum + lsum))
|
|
1290
|
+ done
|
|
1291
|
+ echo "$sum"
|
|
1292
|
+ test "$sum" -gt 0
|
|
1293
|
+}
|
|
1294
|
+
|
1273
|
1295
|
__jat__usage() {
|
1274
|
1296
|
#
|
1275
|
1297
|
# Print usage error $1 and hint according to FUNCNAME
|