fixed logging of elapsed time on Solaris

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@556902 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
William Au 2007-07-17 12:31:03 +00:00
parent 8025c0a2a9
commit 82afc1a8a7
16 changed files with 31 additions and 16 deletions

View File

@ -117,7 +117,7 @@ fi
fixUser "$@"
start=`date +"%s"`
setStartTime
logMessage started by $oldwhoami
logMessage command: $0 $@

View File

@ -117,7 +117,7 @@ fi
fixUser "$@"
start=`date +"%s"`
setStartTime
logMessage started by $oldwhoami
logMessage command: $0 $@

View File

@ -74,7 +74,7 @@ fi
fixUser "$@"
start=`date +"%s"`
setStartTime
logMessage started by $oldwhoami
logMessage command: $0 $@

View File

@ -95,7 +95,7 @@ function remove
/bin/rm -rf $1
}
start=`date +"%s"`
setStartTime
logMessage started by $oldwhoami
logMessage command: $0 $@

View File

@ -103,7 +103,7 @@ fi
fixUser "$@"
start=`date +"%s"`
setStartTime
logMessage started by $oldwhoami
logMessage command: $0 $@

View File

@ -104,7 +104,7 @@ fi
fixUser "$@"
start=`date +"%s"`
setStartTime
logMessage started by $oldwhoami
logMessage command: $0 $@

View File

@ -104,7 +104,7 @@ fi
fixUser "$@"
start=`date +"%s"`
setStartTime
logMessage started by $oldwhoami
logMessage command: $0 $@

View File

@ -60,7 +60,7 @@ done
fixUser "$@"
start=`date +"%s"`
setStartTime
logMessage disabled by $oldwhoami
logMessage command: $0 $@

View File

@ -59,7 +59,7 @@ done
fixUser "$@"
start=`date +"%s"`
setStartTime
logMessage enabled by $oldwhoami
logMessage command: $0 $@

View File

@ -53,6 +53,16 @@ function fixUser
fi
}
function setStartTime
{
if [[ "${OS}" == "SunOS" ]]
then
start=`perl -e "print time;"`
else
start=`date +"%s"`
fi
}
function timeStamp
{
date +'%Y/%m/%d %H:%M:%S'
@ -69,7 +79,12 @@ function logMessage
function logExit
{
end=`date +"%s"`
if [[ "${OS}" == "SunOS" ]]
then
end=`perl -e "print time;"`
else
end=`date +"%s"`
fi
diff=`expr $end - $start`
echo "$(timeStamp) $1 (elapsed time: $diff sec)">>$log
exit $2

View File

@ -101,7 +101,7 @@ function remove
fi
}
start=`date +"%s"`
setStartTime
logMessage started by $oldwhoami
logMessage command: $0 $@

View File

@ -104,7 +104,7 @@ then
master_status_dir=${solr_root}/${master_status_dir}
fi
start=`date +"%s"`
setStartTime
logMessage started by $oldwhoami
logMessage command: $0 $@

View File

@ -156,7 +156,7 @@ function pushStatus
scp -q -o StrictHostKeyChecking=no ${solr_root}/logs/snappuller.status ${master_host}:${master_status_dir}/snapshot.status.`uname -n`
}
start=`date +"%s"`
setStartTime
logMessage started by $oldwhoami
logMessage command: $0 $@

View File

@ -60,7 +60,7 @@ done
fixUser "$@"
start=`date +"%s"`
setStartTime
logMessage disabled by $oldwhoami
logMessage command: $0 $@

View File

@ -60,7 +60,7 @@ done
fixUser "$@"
start=`date +"%s"`
setStartTime
logMessage enabled by $oldwhoami
logMessage command: $0 $@

View File

@ -74,7 +74,7 @@ then
data_dir=${solr_root}/${data_dir}
fi
start=`date +"%s"`
setStartTime
logMessage started by $oldwhoami
logMessage command: $0 $@