diff --git a/bash/harvest-perf.sh b/bash/harvest-perf.sh index eb2c814..fee4854 100755 --- a/bash/harvest-perf.sh +++ b/bash/harvest-perf.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/sur/bin/env bash # # Shell d'extraction de documents (métadonnées + plein texte) avec mesure # de performance (temps d'execution, mesure du trafic / vitesse réseau) diff --git a/bash/perf.sh b/bash/perf.sh new file mode 100644 index 0000000..0bb27cd --- /dev/null +++ b/bash/perf.sh @@ -0,0 +1,27 @@ +#!/sur/bin/env bash +# +# Lanceur de mesures de performances de téléchargement sur l'API +# +# +CUR_DIR=$( cd "$( dirname "$0" )" && pwd ) + +# Arguments +APP="$1" + +# Session +SESSION=$(date +'%Y-%m-%d-%H-%M-%S') + +# +RESULT_DIR="$CUR_DIR/perfs/$SESSION" +mkdir -p "$RESULT_DIR" + +# +TIMEFILE="$RESULT_DIR/time.txt" + +# Commandes +HARVEST="$CUR_DIR/harvest-perf.sh" +TIME="/usr/bin/time -o "$TIMEFILE" --format '%e'" +NET="" + + +"$TIME $APP"