<commit_before>#!/bin/bash

DB=$1
HOST=$2
LOOPS=$3
PAUSETIME=$4
MAXCONNS=$5


docker service rm pws_cmd-$DB

docker service create \
    --name pws_cmd-$DB  \
    --restart-condition none \
    --network pws_default \
    vincentserpoul/playwithsql-cmd-status \
    -db=$DB -host=$HOST -loops=$LOOPS -pausetime=$PAUSETIME -maxconns=$MAXCONNS 

WAITTILFINISH=$(($LOOPS/10));
sleep $WAITTILFINISH;

docker service logs pws_cmd-$DB | awk '{ print $3."," }' >> ./bench/status/swarm/results.log;
docker service rm pws_cmd-$DB;
docker service rm pws_$DB;<commit_msg>better detection of finish task<commit_after>#!/bin/bash

DB=$1
HOST=$2
LOOPS=$3
PAUSETIME=$4
MAXCONNS=$5

docker service rm pws_cmd-$DB

docker service create \
    --name pws_cmd-$DB  \
    --restart-condition none \
    --network pws_default \
    vincentserpoul/playwithsql-cmd-status \
    -db=$DB -host=$HOST -loops=$LOOPS -pausetime=$PAUSETIME -maxconns=$MAXCONNS 


while [ $(docker service ls | grep $DB  | awk '{print $4}' | grep "0/" | wc -l) -lt 1 ] ;do 
    sleep 1s;
done;

docker service logs pws_cmd-$DB | awk '{ print $3."," }' >> ./bench/status/swarm/results.log;
# docker service rm pws_cmd-$DB;
# docker service rm pws_$DB;
{'fraction_non_alphanumeric': 0.15793848711554448, 'fraction_numerical': 0.014962593516209476, 'mean_word_length': 3.543396226415094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3721689', 'n_tokens_mistral': 486, 'n_tokens_neox': 454, 'n_words': 107}