-
Notifications
You must be signed in to change notification settings - Fork 0
/
dbstats.sh
executable file
·27 lines (20 loc) · 1.4 KB
/
dbstats.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
table_prefix="wdraktuell-bot-tg-prod"
echo "Morning:"
aws dynamodb scan --table-name ${table_prefix}-subscriptions --filter-expression "morning = :mo" --expression-attribute-values '{":mo": {"BOOL": true}}' --select "COUNT" | jq .Count
echo ""
echo "Evening:"
aws dynamodb scan --table-name ${table_prefix}-subscriptions --filter-expression "evening = :ev" --expression-attribute-values '{":ev": {"BOOL": true}}' --select "COUNT" | jq .Count
echo ""
echo "Morning and evening:"
aws dynamodb scan --table-name ${table_prefix}-subscriptions --filter-expression "morning = :mo and evening = :ev" --expression-attribute-values '{":mo": {"BOOL": true}, ":ev": {"BOOL": true}}' --select "COUNT" | jq .Count
echo ""
echo "Breaking:"
aws dynamodb scan --table-name ${table_prefix}-subscriptions --filter-expression "breaking = :br" --expression-attribute-values '{":br": {"BOOL": true}}' --select "COUNT" | jq .Count
echo ""
echo "Unique:"
aws dynamodb scan --table-name ${table_prefix}-subscriptions --filter-expression "morning = :mo or evening = :ev or breaking = :br" --expression-attribute-values '{":mo": {"BOOL": true}, ":ev": {"BOOL": true}, ":br": {"BOOL": true}}' --select "COUNT" | jq .Count
echo ""
echo "Analytics enabled: "
aws dynamodb scan --table-name ${table_prefix}-tracking --filter-expression "enabled = :en" --expression-attribute-values '{":en": {"BOOL": true}}' --select "COUNT" | jq .Count
echo ""