[perf-web] Add 'summarize' command for manage.py



commit a3275b87c77a0a51a54d50b9623ee59093f40115
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sun Jun 29 11:19:18 2014 -0400

    Add 'summarize' command for manage.py
    
    Add a custom management command to summarize all new data and save
    it to the database - this will be run from an hourly cron job.

 metrics/management/commands/summarize.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/metrics/management/__init__.py b/metrics/management/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/metrics/management/commands/__init__.py b/metrics/management/commands/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/metrics/management/commands/summarize.py b/metrics/management/commands/summarize.py
new file mode 100644
index 0000000..e408c2e
--- /dev/null
+++ b/metrics/management/commands/summarize.py
@@ -0,0 +1,8 @@
+from django.core.management.base import BaseCommand, CommandError
+from metrics.views import resummarize
+
+class Command(BaseCommand):
+    help = 'Recompute time-range summaries and save the results to the database'
+
+    def handle(self, *args, **options):
+        resummarize()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]