2022-09-09 17:02:48 -07:00
|
|
|
from app.notify_client import NotifyAdminAPIClient, cache
|
2021-03-10 11:01:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class PerformanceDashboardAPIClient(NotifyAdminAPIClient):
|
|
|
|
|
|
2022-09-09 17:02:48 -07:00
|
|
|
@cache.set('performance-stats-{start_date}-to-{end_date}', ttl_in_seconds=3600)
|
2021-03-11 10:52:03 +00:00
|
|
|
def get_performance_dashboard_stats(
|
|
|
|
|
self,
|
|
|
|
|
*,
|
|
|
|
|
start_date,
|
|
|
|
|
end_date,
|
|
|
|
|
):
|
|
|
|
|
return self.get(
|
|
|
|
|
'/performance-dashboard',
|
|
|
|
|
params={
|
|
|
|
|
'start_date': str(start_date),
|
|
|
|
|
'end_date': str(end_date),
|
|
|
|
|
}
|
|
|
|
|
)
|
2021-03-10 11:01:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
performance_dashboard_api_client = PerformanceDashboardAPIClient()
|