File: microbenchmark-test-data.sh

package info (click to toggle)
mongo-cxx-driver 4.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 13,832 kB
  • sloc: cpp: 61,365; python: 1,436; sh: 356; xml: 253; perl: 215; makefile: 21
file content (32 lines) | stat: -rwxr-xr-x 963 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash

# This script is used to fetch the latest test data for the microbenchmark suite. It puts the data in the
# directory $reporoot/data/benchmark. It should be run from the root of the repository.

set -o errexit
set -o nounset

if [ ! -d ".git" ]; then
  echo "$0: This script must be run from the root of the repository" >&2
  exit 1
fi

tmpdir=$(perl -MFile::Temp=tempdir -wle 'print tempdir(TMPDIR => 1, CLEANUP => 0)')
curl -sL https://github.com/mongodb-labs/driver-performance-test-data/archive/master.zip -o "$tmpdir/data.zip"
unzip -d "$tmpdir" "$tmpdir/data.zip" >/dev/null
mkdir -p data/benchmark

pushd "$tmpdir/driver-performance-test-data-master" >/dev/null

tar xf extended_bson.tgz
tar xf parallel.tgz
tar xf single_and_multi_document.tgz

rm extended_bson.tgz
rm parallel.tgz
rm single_and_multi_document.tgz
rm README.md

popd >/dev/null
rsync -ah "$tmpdir/driver-performance-test-data-master/" data/benchmark
rm -rf "$tmpdir"