Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tinybird/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ use the auto mode to make sure all the files are read.
# Querying the data

Once the data is inserted you can create the endpoints needed to run the benchmark using pipes. `run.sh` will iterate through each endpoint.
Set `TINYBIRD_TOKEN` to a Tinybird token with read access before running the script.
13 changes: 6 additions & 7 deletions tinybird/run.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
#!/bin/bash
set -euo pipefail

# Define the base URL and Authorization token
BASE_URL="https://api.tinybird.co/v0/pipes/"
AUTH_HEADER=<TOKEN>
: "${TINYBIRD_TOKEN:?Set TINYBIRD_TOKEN}"
AUTH_HEADER="Authorization: Bearer ${TINYBIRD_TOKEN}"

results="["

for i in {1..43}; do
times=()
for j in {1..3}; do
response=$(curl -s --compressed -H "$AUTH_HEADER" "${BASE_URL}Q${i}.json")

elapsed=$(echo "$response" | jq '.statistics.elapsed')
echo "$elapsed"
times+=($elapsed)
response=$(curl -fsS --compressed -H "$AUTH_HEADER" "${BASE_URL}Q${i}.json")
elapsed=$(jq -er '.statistics.elapsed | numbers' <<< "$response")
times+=("$elapsed")
done
results+=$(printf "[%s,%s,%s]," "${times[0]}" "${times[1]}" "${times[2]}")
done
Expand Down