Skip to content

Commit

Permalink
Make record names consistent for large numbers
Browse files Browse the repository at this point in the history
Also neatens up the generated database file
  • Loading branch information
AlexanderWells-diamond committed Jun 22, 2023
1 parent 7b5d3f4 commit fdbd34c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
5 changes: 1 addition & 4 deletions benchmark/coniql_performance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,7 @@ def main():
t.start()
for i in range(n_pvs):
# Get the PV name
if i < 10:
pv_name = PV_PREFIX + "0" + str(i)
else:
pv_name = PV_PREFIX + str(i)
pv_name = PV_PREFIX + str(i)

t = threading.Thread(
target=coniql_subscription,
Expand Down
24 changes: 11 additions & 13 deletions benchmark/run_performance_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,19 @@ fi
echo "-> Creating EPICS db with $N_PVS PVs"
for ((i=0;i<$N_PVS;i++))
do
if [ $i -lt 10 ]; then
str_name="0$i"
else
str_name="$i"
fi

STR="record(calcout, \"TEST:REC$str_name\"){ field(DESC, \"Performance test record\") \
field(SCAN, \".1 second\") field(A, \"0\") field(CALC, \"A + 1\") field(OUT, \"TEST:REC$str_name.A\")}"
record_name="TEST:REC$i"
cat <<EOF
record(calcout, "$record_name")
{
field(DESC, "Performance test record")
field(SCAN, ".1 second") field(A, "0")
field(CALC, "A + 1")
field(OUT, "$record_name.A")
}
EOF

if [ $i -eq 0 ]; then
echo $STR > $SUB_DIR/coniqlPerformanceTestDb.db
else
echo $STR >> $SUB_DIR/coniqlPerformanceTestDb.db
fi
done
done >$SUB_DIR/coniqlPerformanceTestDb.db


# 1. EPICS IOCS
Expand Down

0 comments on commit fdbd34c

Please sign in to comment.