* Fix for slow --report --last

* Fix for data_is_numeric() calls
This commit is contained in:
Patrick Van der Veken
2019-01-27 19:39:57 +01:00
parent 7630bfcd46
commit c9c02c0d0f
6 changed files with 47 additions and 34 deletions
+1 -6
View File
@@ -557,11 +557,6 @@ then
then
die "you cannot specify '--today' with '--id'"
fi
# switch on history for --last & --today
if (( ARG_LAST > 0 )) || (( ARG_TODAY > 0 ))
then
ARG_HISTORY=1
fi
fi
if (( DO_REPORT_STD == 0 )) && (( ARG_LAST > 0 ))
then
@@ -853,7 +848,7 @@ then
# determine ALL_MSG_STC (sum of all STCs)
ALL_MSG_STC=$(print "${HC_MSG_VAR}" | awk -F"${MSG_SEP}" 'BEGIN { stc = 0 } { for (i=1;i<=NF;i++) { stc = stc + $1 }} END { print stc }' 2>/dev/null)
(( ARG_DEBUG > 0 )) && debug "HC all STC: ${ALL_MSG_STC}"
data_is_numeric ${ALL_MSG_STC} || die "HC all STC computes to a non-numeric value"
data_is_numeric "${ALL_MSG_STC}" || die "HC all STC computes to a non-numeric value"
else
# nothing to do
return 0
+9 -1
View File
@@ -30,7 +30,7 @@
function report_std
{
# ------------------------- CONFIGURATION starts here -------------------------
typeset _VERSION="2019-01-24" # YYYY-MM-DD
typeset _VERSION="2019-01-27" # YYYY-MM-DD
typeset _SUPPORTED_PLATFORMS="AIX,HP-UX,Linux" # uname -s match
# ------------------------- CONFIGURATION ends here ---------------------------
@@ -198,6 +198,14 @@ else
fi
fi
# general note: history or not?
if (( ARG_HISTORY > 0 ))
then
print "NOTE: showing results with all history (archive) included (--with-history)"
else
print "NOTE: showing results only of current log entries (use --with-history to view all entries)"
fi
# check consistency of log(s)
find ${_LOG_STASH} -type f -print 2>/dev/null | while read _CHECK_FILE
do