# Forums | Mahara Community

## Support / Site statistics do not work correctly

Posts: 7

06 November 2017, 10:30 PM

Hi.

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?

Thank you

Posts: 366
##### Re: Site statistics do not work correctly

07 November 2017, 7:53 AM

Hi Juan,

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

Cheers

Robert

Posts: 7
##### Re: Site statistics do not work correctly

08 November 2017, 6:02 AM

Hi Robert,

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.

Cheers

Juan

Posts: 7
##### Re: Site statistics do not work correctly

10 November 2017, 10:01 PM

Hi Robert.

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.

Cheers

Juan

Posts: 7
##### Re: Site statistics do not work correctly

15 November 2017, 12:45 AM

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

Cheers

Juan

Posts: 366
##### Re: Site statistics do not work correctly

15 November 2017, 8:43 AM

Hi Juan

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';

Eg:

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

Cheers

Robert

Posts: 7
##### Re: Site statistics do not work correctly

16 November 2017, 4:18 AM

Hi Robert.

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.

Cheers

Juan

7 results