Add nightly benchmark script.

This commit adds a script for executing a nightly benchmark and posting
the results to Slack.
This commit is contained in:
Ben Johnson 2020-12-17 09:23:40 -07:00
parent 513743f30d
commit cfdc7f4c63
2 changed files with 41 additions and 0 deletions

34
scripts/bench.sh Normal file
View file

@ -0,0 +1,34 @@
#!/bin/bash
# This script runs benchmarks and posts them to Slack's #nightly channel.
# The caller of the script should `git pull` on the pilosa repo before executing.
#
# Environment variables:
# - PILOSA_SRC: Path to pilosa src directory.
# - SLACK_OAUTH_TOKEN: Token used to post to Slack.
# Require environment variables.
: "${PILOSA_SRC:?Must set PILOSA_SRC environment variable}"
: "${SLACK_OAUTH_TOKEN:?Must set SLACK_OAUTH_TOKEN environment variable}"
# Build pilosa into GOBIN.
make -C $PILOSA_SRC install
# Retrieve current SHA.
SHA=$(git -C $PILOSA_SRC rev-parse HEAD)
# Format current date.
DATE=$(date '+%Y%m%d')
# Execute RBF/Roaring benchmark.
RBF_PATH=gloat/data/1d/rbf/${DATE}.tar.gz
TXSRC=rbf gloat run -v -o $RBF_PATH "${BASH_SOURCE%/*}/etc/gloat/gh.1d.yml"
ROARING_PATH=gloat/data/1d/roaring/${DATE}.tar.gz
TXSRC=roaring gloat run -v -o $ROARING_PATH "${BASH_SOURCE%/*}/etc/gloat/gh.1d.yml"
# Generate graph from results.
gloat graph -layout 3,2 -size 2048,1024 -name utime,stime,heap_alloc,heap_inuse,heap_objects,num_gc -series rbf,roaring -o /tmp/output.png $RBF_PATH $ROARING_PATH
# Post graph to Slack with SHA.
curl -F file=@/tmp/output.png -F channels=C01HBFKRLGH -F "initial_comment=RBF vs Roaring, $DATE ($SHA)" -H "Authorization: Bearer $SLACK_OAUTH_TOKEN" https://slack.com/api/files.upload

View file

@ -0,0 +1,7 @@
name: "GitHub Import Load Testing (1 day)"
main: "pilosa server --data-dir ${TMPDIR} --txsrc ${TXSRC}"
load: "molecula-consumer-github -i events -d id --record-type event --batch-size=100000 --start-time 2020-01-01T00:00:00Z --end-time 2020-01-01T23:00:00Z --cache-dir .githubarchive"
health_url: "http://localhost:10101/status"
debug_url: "http://localhost:10101/debug"