analytics: Add lib/ function to drop all analytics tables.

This commit is contained in:
Rishi Gupta
2017-01-06 18:23:44 -08:00
committed by Tim Abbott
parent 73dc904e9c
commit f5899dd14b
2 changed files with 13 additions and 13 deletions

View File

@@ -115,6 +115,14 @@ def do_delete_count_stat_at_hour(stat, end_time):
RealmCount.objects.filter(property = stat.property, end_time = end_time).delete()
InstallationCount.objects.filter(property = stat.property, end_time = end_time).delete()
def do_drop_all_analytics_tables():
# type: () -> None
UserCount.objects.all().delete()
StreamCount.objects.all().delete()
RealmCount.objects.all().delete()
InstallationCount.objects.all().delete()
FillState.objects.all().delete()
def do_aggregate_to_summary_table(stat, end_time, interval):
# type: (CountStat, datetime, str) -> None
cursor = connection.cursor()