Skip to content

Commit a332fef

Browse files
Add collection script to repository
This will be wrapped in a thin shell that sets up the private environment variables on the server.
1 parent 807246b commit a332fef

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

collector/collect.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
# This script expects SITE_URL and DATABASE to be defined in the environment
4+
5+
set -u -o pipefail
6+
7+
echo "Running collector targeting $SITE_URL"
8+
9+
export RUST_LOG=collector=trace,collector::sysroot=debug
10+
export PATH="/home/collector/.cargo/bin:$PATH"
11+
12+
while : ; do
13+
cargo +nightly build --release -p collector
14+
15+
touch todo-artifacts
16+
for x in $(cat todo-artifacts) ; do
17+
echo "Benching $x from todo-artifacts"
18+
target/release/collector bench_published $x --db $DATABASE;
19+
done
20+
rm todo-artifacts
21+
touch todo-artifacts
22+
23+
target/release/collector bench_next $SITE_URL --self-profile --db $DATABASE;
24+
test $? -gt 0 && echo "sleeping 30 seconds -- failure detected" && sleep 30;
25+
echo sleeping for 30sec at `date`;
26+
sleep 30;
27+
done

0 commit comments

Comments
 (0)