Forums | Mahara Community
Site statistics do not work correctly
06 November 2017, 22:30
The daily statistics of my Mahara site do not register the daily access of the users correctly.
Insert below a screenshot of the statistics of my site Mahara.
Mahara version = 16.10.5
Only a few months ago this site is installed, but it has never registered users' daily access although all other statistical data is correct.
What can be the cause of this problem?
07 November 2017, 7:53
The 'Logged in' column should be populated by data from the 'site_data' database table where the 'type' column = 'loggedin-users-daily'.
If the data does not exist in the database can you make sure the cron is running for the site. On the admin/index.php page there is a 'Mahara: Site information' box which should say Cron Running normally. If it doesn't then check out https://wiki.mahara.org/wiki/System_Administrator%27s_Guide/Cron_Job for some tips to get it running.
If the data does exist are you able to paste some of the database rows here so I can test with them
08 November 2017, 6:02
Thank you very much for your answer.
I have verified that the cron is running because on the admin / index.php page it says "Cron Running normally".
Insert below a screenshot where you can see this message.
At the moment this problem does not seem very worrying because everything else works correctly.
In my previous message I forgot to include the following information:
Database = MySQL
Cron runs every 5 minutes
As you can see in the screenshot there are still few users and also few contents, so if you think that the problem is not serious it might be better to do nothing at the moment.
Thank you very much for your help.
10 November 2017, 22:01
We have already solved the problem with statistics.
We do not know exactly what was the cause of the problem, but we stopped the cron for a few hours and when we re-executed it started to correctly record all the statistics data.
Thank you very much for your help and your advice.
15 November 2017, 0:45
Hello everyone :-)
Although it seemed that the problem was solved, in reality it was not true. The problem continues as before.
I describe the problem exactly:
If we stop the cron for long enough for the message "Cron is not running" to appear, the next time we run the cron, the "Logged in" data is correctly registered in the statistics page.
But if the cron is running normally (without the message "Cron is not running"), no data is recorded in the "Logged in" section.
However, all other data on the statistics page is always recorded correctly.
Maybe it would be better for me to report this problem as a bug?
Thank you very much
15 November 2017, 8:43
The info for that 'Logged in' column is generated via a cron function 'cron_site_data_daily' in the 'cron' table. To see what it's settings are:
SELECT * FROM cron WHERE callfunction = 'cron_site_data_daily';
id | callfunction | nextrun | minute | hour | day | month | dayofweek
15 | cron_site_data_daily | 2017-11-15 23:51:00 | 51 | 23 | * | * | *
That will only run once a day (in my case at 9 minutes before midnight)
So it will not have an up to date/real time count.
Some of the statistical output is generated once daily (or weekly) outside normal operating hours to avoid putting extra strain on the site/database.
If you need a more up to the minute results you can adjust when the hour/minute info for the cron event
16 November 2017, 4:18
I believe that with this new information I will be able to solve the problem.
I thank you very much for all the help you are giving me.