Added new endpoint to get the new template stats

Added a new endpoint which combines the usage of the stats table and the
data from the notifications tables, instead of using all the data from
the notification_history table. This should speed up the query times
and improve the page performance.

- Updated to make the stats create and update function transactional as
it actually wasn't committing the data to the table
- Added the get from the stats table
- Add a a method to combine the two results
- Added the endpoint
This commit is contained in:
Richard Chapman
2017-11-14 14:32:34 +00:00
parent d9f885b881
commit c27edf5e3c
9 changed files with 466 additions and 39 deletions

View File

@@ -242,7 +242,7 @@ class Config(object):
'schedule': crontab(),
'options': {'queue': QueueNames.PERIODIC}
},
'daily-stats-template_usage_by_month': {
'daily-stats-template-usage-by-month': {
'task': 'daily-stats-template_usage_by_month',
'schedule': crontab(hour=0, minute=50),
'options': {'queue': QueueNames.PERIODIC}