Created
May 28, 2020 06:11
-
-
Save fervic/ee967cea9a0338f115d44df46c318609 to your computer and use it in GitHub Desktop.
My rough Big Query jobs expenses calculator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
bq ls -j -n 10000 | grep SUCCESS | awk '{print $1}' | \ | |
xargs -n 1 bq --format prettyjson show -j | \ | |
jq .statistics.query.totalBytesBilled | \ | |
sed s/\"//g | \ | |
awk '{ sum += $1 } END { print sum/1024/1024/1024 }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment