portbase=11000
DAEMONS $(seq 3)
echo '{"job-id" : 10364, "rank" : 1, "kokkos-perf-data" : [ {"name" : "SPARTAFOO0", "count": 0, "time": 0.0000},{"name" : "SPARTAFOO1", "count": 1, "time": 0.0001},{"name" : "SPARTAFOO2", "count": 2, "time": 0.0002},{"name" : "SPARTAFOO3", "count": 3, "time": 0.0003},{"name" : "SPARTAFOO4", "count": 4, "time": 0.0004},{"name" : "SPARTAFOO5", "count": 5, "time": 0.0005},{"name" : "SPARTAFOO6", "count": 6, "time": 0.0006},{"name" : "SPARTAFOO7", "count": 7, "time": 0.0007},{"name" : "SPARTAFOO8", "count": 8, "time": 0.0008},{"name" : "SPARTAFOO9", "count": 9, "time": 0.0009}] }' > $TESTDIR_FAST/x.json
echo '{"job-id" : 10364, "rank" : 1, "kokkos-perf-data" : [ {"name" : "SPARTAFOO0", "count": 0, "time": 0.0000},{"name" : "SPARTAFOO1", "count": 1, "time": 0.0001},{"name" : "SPARTAFOO2", "count": 2, "time": 0.0002},{"name" : "SPARTAFOO3", "count": 3, "time": 0.0003},{"name" : "SPARTAFOO4", "count": 4, "time": 0.0004},{"name" : "SPARTAFOO5", "count": 5, "time": 0.0005},{"name" : "SPARTAFOO6", "count": 6, "time": 0.0006},{"name" : "SPARTAFOO7", "count": 7, "time": 0.0007},{"name" : "SPARTAFOO8", "count": 8, "time": 0.0008},{"name" : "SPARTAFOO9", "count": 9, "time": 0.0009}] }' > $TESTDIR_FAST/y.json
VGARGS="--leak-check=full --show-leak-kinds=definite --track-origins=yes --trace-children=yes"
vgon
LDMSD 1 # publish to with -l
LDMSD 2 # publish to without -l
LDMSD 3 # store
SLEEP 2
vgoff
threads=$(nproc --all)
pubs=10
if test "$bypass" = "1"; then
	MESSAGE skipping publications
else
	/bin/rm -f $LOGDIR/lsp.1.* $LOGDIR/lsp.2.*
	for i in $(seq $threads); do
		ldmsd_stream_publish -p $port1 -a none -s foo -t json -x sock -h localhost -l -r $pubs -f $TESTDIR_FAST/x.json >> $LOGDIR/lsp.1.$i &
		ldmsd_stream_publish -p $port2 -a none -s bar -t json -x sock -h localhost -r $pubs -f $TESTDIR_FAST/y.json >> $LOGDIR/lsp.2.$i &
	done
	ps guxw |grep ldmsd_stream_publish
	MESSAGE publish launches done
fi

SLEEP 10
MESSAGE stopping ldmsd_stream_publish
pkill ldmsd_stream_publish
SLEEP 10
KILL_LDMSD $(seq 3)
file_created $STOREDIR/blobs/foo.*
file_created $STOREDIR/blobs/bar.*
file_created $STOREDIR/node/dstat
