Skip to content

Instantly share code, notes, and snippets.

@davaymne
Last active December 13, 2020 22:14
Show Gist options
  • Save davaymne/b638165960f16801735d84a211667bcc to your computer and use it in GitHub Desktop.
Save davaymne/b638165960f16801735d84a211667bcc to your computer and use it in GitHub Desktop.
#!/bin/bash
# Loga may contain different subgraphs - filter subgrafs manualy first of all
NAME_BASE=$(echo $1 | cut -d'.' -f 1)
SUMMARY_JSONL="${NAME_BASE}-summary.jsonl"
OUTPUT_JSONL="${NAME_BASE}.jsonl"
TREEBUF="${NAME_BASE}.treebuf"
AGORA=<PATH>agora1/agora/target/release/agora
echo "Converting log to jsonl $1"
grep 'Query timing' $1 | qlog process --text --graphql $SUMMARY_JSONL --output $OUTPUT_JSONL
echo "Agora..."
sed -i 's/\\"/"/g' $OUTPUT_JSONL
sed -i 's/\\"/"/g' $OUTPUT_JSONL
sed -i 's/\\"/"/g' $SUMMARY_JSONL
sed -i 's/\\"/"/g' $SUMMARY_JSONL
sed -i 's/time/effort/g' $OUTPUT_JSONL
$AGORA --load-log $OUTPUT_JSONL --sample 1 --save-log $TREEBUF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment