Download Count not working on OPS 3.2 Beta (current-April 2020)

I made a fresh install with the new release of OPS (14 April, 2020).

But, i noticed that the “Download Count” is not working.

I mentioned this in my earlier post:

Can anyone point me in the right direction towards resolving this?

Thanks a million to the PKP Team.

The downloads in OPS (and other applications) work with scheduled tasks which run once a day. Meaning that if you download a preprint today, it will show up in the download stats with a delay of 1-24 hours depending on when the scheduled task is run.

The data is first saved to actual log files in “files/usageStats” folder in OPS. When you download a preprint, you should see a corresponding line in files/usageStats/usageEventLogs". The “usageEventLogs” subfolder is the folder where the current log file lives in. When the day is over the system will start a new log file and the old one is processed with the task and moved to the “archive” folder.

Let me know if you are not seeing any log files or lines in the files.

Using the same files folder for two separate applications is likely to cause errors or problems in the long run. So yes use separate folders

Probably what is happening is that OJS scheduled task runs first and moves the log file to the archive. Therefore when the OPS scheduled task kicks in, there is no log file to be processed for it.

I have separated them. But still not counting. Download coun remains: 0

Hi @ajnyga!

Sorry if I am being off-topic here, but is there a way to reduce this 24hrs interval? Is it something that can be done at server level? I mean, an adjustment that would only work for our server.

The usage stats are programmed to create a single log file for each day. When the day changes, the system will create a new log file and old one will be staged for processing.

When the task is then fired, it will look for yesterday’s log file and process that. And the move it to the archive.

This means that firing the task several times per day does not help. There is nothing to be processed because it is all based on daily log files. The system will not let you process today’s log file.

This is of course code that can be changed. But I have not looked in detail what are all the implications for GitHub - pkp/usageStats plugin. @asmecher probably has a more detailed idea.

Thanks @ajnyga!

We are very interested in cutting down from daily to, say, at least hourly updates, but ideally it would be best if they were on the fly.

Would like to hear what @asmecher might have to add.

Hi all,

The statistics framework that processes the logs needs to do a bunch of things for COUNTER (which are generally a good idea for reliable numbers) like debouncing, bot removal, etc. but which are not suitable for instant feedback. If you’re looking for numbers that reflect changes instantly, tools like Google Analytics etc. might be better.

Alec Smecher
Public Knowledge Project Team

1 Like