Created
December 13, 2020 19:01
-
-
Save davaymne/5c6eb9fa20ad1e8b5a0655786eeb359a to your computer and use it in GitHub Desktop.
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
# Consumes json summary file | |
# output call count per subgraph | |
summaries="" | |
day=2020115 | |
day_summary=$(jq -s 'group_by(.subgraph) | | |
map({"subgraph":(.[0].subgraph), "calls":(reduce .[].calls as $calls (0; . + $calls)), "date":("'$day'") }) | | |
map([.subgraph, .calls, .date] | join(", ")) | join(" \r\n ")' < $1) | |
summaries+="${day_summary//\"} \r\n" | |
printf "${summaries//\"}" > subgraph_daily_summary.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment