Select the time range and type in the following command
stopwatch_events = query_bucket(find_bucket("aw-stopwatch"));
RETURN = stopwatch_events;
Save them to a file named stopwatch.json
and use the following jq-commands to gather data.
jq < stopwatch.json 'map(. + {"date":(.timestamp | capture("(?<time>\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2})") | .time + "Z" | fromdate | strftime("%Y-%m-%d"))})' > stopwatch-date-added.json
jq < stopwatch.json 'group_by(.data.label) | map(.[0] + {"count": length, "duration": (map(.duration) | add)}) | map(. + {"hours": (.duration / 60 / 60 | tostring | capture("(?<number>\\d+\\.{0,1}\\d{0,2})") | .number | tonumber)})'
jq < stopwatch-date-added.json 'group_by(.date,.data.label) | map(.[0] + {"count": length, "duration": (map(.duration) | add)}) | map(. + {"hours": (.duration / 60 / 60 | tostring | capture("(?<number>\\d+\\.{0,1}\\d{0,2})") | .number | tonumber)})' > stopwatch-grouped.json