<commit_before>#!/bin/bash          
# simple test with no failures, no failures locally

# first args is number of servers (don't forget to change server config file)
# 2nd args is number of client

# tidy up from previous tests
cd $GOPATH/src/github.com/heidi-ann/hydra

rm server/*.temp
rm -r scripts/results/$1s$2c/*
rm scripts/serv.conf

# make results directory
mkdir scripts/results/$1s$2c

# generate server configuration files
cd scripts
./generate_serv_conf.sh $1
cd ..

# start server
cd server
echo "starting $1 servers"
for ((id=0; id<$1; id++))
do
	$GOPATH/bin/server -id=$id -client-port=808$id -peer-port=809$id -config=../scripts/serv.conf &
done

# start clients 
cd ../client
echo "starting $2 clients"
for ((id=0; id<$2; id++))
do
	$GOPATH/bin/client -id=$id -mode=test -stat=../scripts/results/$1s$2c/latency_$id.csv &
done

# stop 
sleep 20
kill $(jobs -p)

# produce CDF of latency<commit_msg>no longer overwritting old results<commit_after>#!/bin/bash          
# simple test with no failures, no failures locally

# first args is number of servers (don't forget to change server config file)
# 2nd args is number of client

# tidy up from previous tests
cd $GOPATH/src/github.com/heidi-ann/hydra

rm server/*.temp
rm scripts/serv.conf

TIME=`date '+%m-%d-%H%M%S'`

# make results directory
mkdir -p scripts/results/$TIME/$1s$2c

# generate server configuration files
cd scripts
./generate_serv_conf.sh $1
cd ..

# start servers
cd server
echo "starting $1 servers"
for ((id=0; id<$1; id++))
do
	$GOPATH/bin/server -id=$id -client-port=808$id -peer-port=809$id -config=../scripts/serv.conf &
done

# start clients 
cd ../client
echo "starting $2 clients"
for ((id=0; id<$2; id++))
do
	$GOPATH/bin/client -id=$id -mode=test -stat=../scripts/results/$TIME/$1s$2c/latency_$id.csv &
done

# stop 
sleep 20
kill $(jobs -p)

echo "done, results in scripts/results/$TIME/$1s$2c"
# produce CDF of latency
{'fraction_non_alphanumeric': 0.14375, 'fraction_numerical': 0.022916666666666665, 'mean_word_length': 3.8632911392405065, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '1742200', 'n_tokens_mistral': 724, 'n_tokens_neox': 685, 'n_words': 214}