Commit a6460107 authored by Frank Winkler's avatar Frank Winkler

Modified scalability tests.

parent 0197b121
......@@ -236,7 +236,7 @@ def send_data_to_db(influx_con, hostname, send_number, sample_rate):
def main(database,output,nodeid):
def main(database, output, nodeid, protocol):
# connection data for InfluxDB
host = os.environ["STRESS_HOST"]
......@@ -251,7 +251,13 @@ def main(database,output,nodeid):
# connect to database
connect_start = int(time.time())
influx_con = InfluxDBClient(host, port, user, password, database)
if protocol == 'http':
influx_con = InfluxDBClient(host, port, user, password, database)
else:
#udp
influx_con = InfluxDBClient(host=host, database=database, use_udp=True, udp_port=8089)
connect_end = int(time.time())
#wait until current time has delay value
......@@ -277,6 +283,7 @@ def parse_args():
parser.add_argument('--db_name', type=str, required=True)
parser.add_argument('--output', type=str, required=True)
parser.add_argument('--nodeid', type=str, required=True)
parser.add_argument('--protocol', type=str, required=True)
return parser.parse_args()
......@@ -284,4 +291,5 @@ if __name__ == '__main__':
args = parse_args()
main(database=args.db_name,
output=args.output,
nodeid=args.nodeid)
nodeid=args.nodeid,
protocol=args.protocol)
......@@ -7,9 +7,10 @@ NODE_NUM=10 #11 #14 #42
#determine measurement parameters
SAMPLE_RATE=2
BATCH_SIZE=172 #106
VALUES_PER_MEASUREMENT=172 #106
BATCH_SIZE=106
VALUES_PER_MEASUREMENT=106
SEND_NUMBER=$((60/SAMPLE_RATE * 120)) #120 simulation minutes
PROTOCOL="http"
#fix settings
NTASKS=24
......@@ -44,11 +45,13 @@ create_job_script()
echo "export BATCH_SIZE=${BATCH_SIZE}" >> $JOB_SCRIPT
echo "export VALUES_PER_MEASUREMENT=${VALUES_PER_MEASUREMENT}" >> $JOB_SCRIPT
echo "export SEND_NUMBER=${SEND_NUMBER}" >> $JOB_SCRIPT
echo "export PROTOCOL=${PROTOCOL}" >> $JOB_SCRIPT
echo "srun -n $SIM_NODES sh stress_start.sh" >> $JOB_SCRIPT
}
run_stress_test()
{
source /sw/taurus/tools/pika/pika-current.conf
COUNTS_1=$(get_measurement_counts)
JOB_SUBMIT=`sbatch $JOB_SCRIPT`
JOB_ID=`echo $JOB_SUBMIT | cut -d " " -f 4`
......@@ -78,13 +81,23 @@ run_stress_test()
clean_influx()
{
source /sw/taurus/tools/pika/.pika_access
INFLUX_CONF="$STRESS_HOST:8086/query -u ${INFLUXDB_USER}:${INFLUXDB_PASSWORD} --data-urlencode"
curl -POST $INFLUX_CONF "q=DROP DATABASE stress"
sleep 3
curl -POST $INFLUX_CONF "q=CREATE DATABASE stress"
curl -POST $INFLUX_CONF "q=CREATE RETENTION POLICY frob ON stress DURATION 28d REPLICATION 1 SHARD DURATION 7d DEFAULT"
#curl -POST $INFLUX_CONF "q=CREATE DATABASE stress"
#curl -POST $INFLUX_CONF "q=CREATE RETENTION POLICY longterm ON stress DURATION INF REPLICATION 1 SHARD DURATION 7d"
influxd restore -portable -db "prope" -newdb "stress" /tmp/566_1575244800 &
sleep 1
curl -POST $INFLUX_CONF "q=ALTER RETENTION POLICY frob ON stress DURATION inf SHARD DURATION 7d"
wait
echo "Restore stress finished"
sleep 10
}
get_measurement_counts()
......@@ -92,7 +105,7 @@ get_measurement_counts()
echo `python3 get_points.py`
}
clean_influx
#clean_influx
create_job_script
run_stress_test
......@@ -8,4 +8,4 @@ PIKA_HOSTNAME=$(hostname | cut -d. -f1)
#switch time logging on/off
export TIME_LOGGING=true
python3 $PWD/stress_influx_db.py --db_name="stress" --output=$OUTPUT_PATH --nodeid=${PIKA_HOSTNAME}${SLURM_PROCID}
python3 $PWD/stress_influx_db.py --db_name="stress" --output=$OUTPUT_PATH --nodeid=${PIKA_HOSTNAME}${SLURM_PROCID} --protocol=$PROTOCOL
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment