Skip to content

Instantly share code, notes, and snippets.

@adammcmaster
Last active June 19, 2020 15:05
Show Gist options
  • Save adammcmaster/f57a793d66b63a043774eb3f10f6d05f to your computer and use it in GitHub Desktop.
Save adammcmaster/f57a793d66b63a043774eb3f10f6d05f to your computer and use it in GitHub Desktop.
Panoptes benchmarking
#!/bin/bash -e
ENDPOINT="${1:-https://panoptes-staging.zooniverse.org}"
export PANOPTES_CLIENT_ID=e094b63362fdef0548e0bbcc6e6cb5996c422d3a770074ef972432d57d41049c
CMD="panoptes -e ${ENDPOINT}"
echo "Running simultaneous full project listings..."
for i in {1..10}
do
$CMD project ls >/dev/null&
done
time wait
echo "Running simultaneous full workflow listings..."
for i in {1..10}
do
$CMD workflow ls >/dev/null&
done
time wait
echo "Creating benchmark project..."
PROJECT=$($CMD project create -p "BENCHMARK $(date)" BENCHMARK | awk '{print$1}')
$CMD project ls -p $PROJECT
SUBJECT_SET=$($CMD subject-set create $PROJECT BENCHMARK | awk '{print$1}')
$CMD subject-set ls $SUBJECT_SET
MANIFEST=$(mktemp)
echo "Running subject uploads..."
echo "URL" > $MANIFEST
for i in {1..1000}
do
echo "https://example.com/image.png" >> $MANIFEST
done
time $CMD --admin subject-set upload-subjects $SUBJECT_SET -r 1 $MANIFEST
rm -f $MANIFEST
echo "Downloading subjects export..."
EXPORT=$(mktemp)
time $CMD --admin project download -g -t subjects $PROJECT $EXPORT
rm -f $EXPORT
$CMD project delete -f $PROJECT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment