This is a huge pull request that brings massive changes and performance improvements to the Botmetrics codebase:
DashboardsController is extremely simplified and has a single way for getting numbers for dashboards (regardless of the dashboard type)
We introduce the concept of RolledupEvent which is used to calculate dashboard counts/growth numbers as well as insights into users. Events are rolled up to the closest hour by user and bot instance which makes it much much faster to query.
We use Postgres triggers and UPSERTs to make sure that when Events are added to the database via the EventsController, events are rolled up and stored in RolledupEventQueue.
With these changes, Botmetrics is able to query very large datasets with a query time of 200-400ms (with suitable hardware).
This is a huge pull request that brings massive changes and performance improvements to the Botmetrics codebase:
DashboardsController
is extremely simplified and has a single way for getting numbers for dashboards (regardless of the dashboard type)RolledupEvent
which is used to calculate dashboard counts/growth numbers as well as insights into users. Events are rolled up to the closest hour by user and bot instance which makes it much much faster to query.UPSERT
s to make sure that when Events are added to the database via theEventsController
, events are rolled up and stored inRolledupEventQueue
.With these changes, Botmetrics is able to query very large datasets with a query time of 200-400ms (with suitable hardware).