Develop a statistical registration system
Due to the high volume of tracking data, it becomes impractical (and sometimes very very slow) to generate statistical data (usage by day, week, month, year) on the original data.
As we started in 1.8.8 to really develop some kind of structured cron system, we should take this as an opportunity to trigger daily statistical-collection activities.
To allow for cron to be run at any frequency, we should save the "last cron run" in a table.
For example, a first implementation (and the idea behind this task) would be to implement a cron_run table:
CREATE TABLE cron_run ( id int PRIMARY KEY not null AUTO_INCREMENT, last_run datetime, output text );
One of the cron tasks should actually go through the track_e_access and collect the total connection times, day by day since the last cron run, of all students, and store it into a resume table:
CREATE TABLE stats_daily_user_connect( id int not null PRIMARY KEY AUTO_INCREMENT, ending datetime, -- time of ending the day, should be the same for all users the same day time_spent int, -- time in seconds cron_run_id int );
This table could later be queried to generate charts much quicker to know how long a user has been connected in the next 12 months or so.