mirror of https://github.com/apache/lucene.git
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:
parent
8025c0a2a9
commit
82afc1a8a7
|
@ -117,7 +117,7 @@ fi
|
||||||
|
|
||||||
fixUser "$@"
|
fixUser "$@"
|
||||||
|
|
||||||
start=`date +"%s"`
|
setStartTime
|
||||||
|
|
||||||
logMessage started by $oldwhoami
|
logMessage started by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
|
@ -117,7 +117,7 @@ fi
|
||||||
|
|
||||||
fixUser "$@"
|
fixUser "$@"
|
||||||
|
|
||||||
start=`date +"%s"`
|
setStartTime
|
||||||
|
|
||||||
logMessage started by $oldwhoami
|
logMessage started by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
|
@ -74,7 +74,7 @@ fi
|
||||||
|
|
||||||
fixUser "$@"
|
fixUser "$@"
|
||||||
|
|
||||||
start=`date +"%s"`
|
setStartTime
|
||||||
|
|
||||||
logMessage started by $oldwhoami
|
logMessage started by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
|
@ -95,7 +95,7 @@ function remove
|
||||||
/bin/rm -rf $1
|
/bin/rm -rf $1
|
||||||
}
|
}
|
||||||
|
|
||||||
start=`date +"%s"`
|
setStartTime
|
||||||
|
|
||||||
logMessage started by $oldwhoami
|
logMessage started by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
|
@ -103,7 +103,7 @@ fi
|
||||||
|
|
||||||
fixUser "$@"
|
fixUser "$@"
|
||||||
|
|
||||||
start=`date +"%s"`
|
setStartTime
|
||||||
|
|
||||||
logMessage started by $oldwhoami
|
logMessage started by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
|
@ -104,7 +104,7 @@ fi
|
||||||
|
|
||||||
fixUser "$@"
|
fixUser "$@"
|
||||||
|
|
||||||
start=`date +"%s"`
|
setStartTime
|
||||||
|
|
||||||
logMessage started by $oldwhoami
|
logMessage started by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
|
@ -104,7 +104,7 @@ fi
|
||||||
|
|
||||||
fixUser "$@"
|
fixUser "$@"
|
||||||
|
|
||||||
start=`date +"%s"`
|
setStartTime
|
||||||
|
|
||||||
logMessage started by $oldwhoami
|
logMessage started by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
|
@ -60,7 +60,7 @@ done
|
||||||
|
|
||||||
fixUser "$@"
|
fixUser "$@"
|
||||||
|
|
||||||
start=`date +"%s"`
|
setStartTime
|
||||||
|
|
||||||
logMessage disabled by $oldwhoami
|
logMessage disabled by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
|
@ -59,7 +59,7 @@ done
|
||||||
|
|
||||||
fixUser "$@"
|
fixUser "$@"
|
||||||
|
|
||||||
start=`date +"%s"`
|
setStartTime
|
||||||
|
|
||||||
logMessage enabled by $oldwhoami
|
logMessage enabled by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
|
@ -53,6 +53,16 @@ function fixUser
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setStartTime
|
||||||
|
{
|
||||||
|
if [[ "${OS}" == "SunOS" ]]
|
||||||
|
then
|
||||||
|
start=`perl -e "print time;"`
|
||||||
|
else
|
||||||
|
start=`date +"%s"`
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function timeStamp
|
function timeStamp
|
||||||
{
|
{
|
||||||
date +'%Y/%m/%d %H:%M:%S'
|
date +'%Y/%m/%d %H:%M:%S'
|
||||||
|
@ -69,7 +79,12 @@ function logMessage
|
||||||
|
|
||||||
function logExit
|
function logExit
|
||||||
{
|
{
|
||||||
end=`date +"%s"`
|
if [[ "${OS}" == "SunOS" ]]
|
||||||
|
then
|
||||||
|
end=`perl -e "print time;"`
|
||||||
|
else
|
||||||
|
end=`date +"%s"`
|
||||||
|
fi
|
||||||
diff=`expr $end - $start`
|
diff=`expr $end - $start`
|
||||||
echo "$(timeStamp) $1 (elapsed time: $diff sec)">>$log
|
echo "$(timeStamp) $1 (elapsed time: $diff sec)">>$log
|
||||||
exit $2
|
exit $2
|
||||||
|
|
|
@ -101,7 +101,7 @@ function remove
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
start=`date +"%s"`
|
setStartTime
|
||||||
|
|
||||||
logMessage started by $oldwhoami
|
logMessage started by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
|
@ -104,7 +104,7 @@ then
|
||||||
master_status_dir=${solr_root}/${master_status_dir}
|
master_status_dir=${solr_root}/${master_status_dir}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
start=`date +"%s"`
|
setStartTime
|
||||||
|
|
||||||
logMessage started by $oldwhoami
|
logMessage started by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
|
@ -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`
|
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 started by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
|
@ -60,7 +60,7 @@ done
|
||||||
|
|
||||||
fixUser "$@"
|
fixUser "$@"
|
||||||
|
|
||||||
start=`date +"%s"`
|
setStartTime
|
||||||
|
|
||||||
logMessage disabled by $oldwhoami
|
logMessage disabled by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
|
@ -60,7 +60,7 @@ done
|
||||||
|
|
||||||
fixUser "$@"
|
fixUser "$@"
|
||||||
|
|
||||||
start=`date +"%s"`
|
setStartTime
|
||||||
|
|
||||||
logMessage enabled by $oldwhoami
|
logMessage enabled by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
|
@ -74,7 +74,7 @@ then
|
||||||
data_dir=${solr_root}/${data_dir}
|
data_dir=${solr_root}/${data_dir}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
start=`date +"%s"`
|
setStartTime
|
||||||
|
|
||||||
logMessage started by $oldwhoami
|
logMessage started by $oldwhoami
|
||||||
logMessage command: $0 $@
|
logMessage command: $0 $@
|
||||||
|
|
Loading…
Reference in New Issue