Closed tonyellow closed 3 years ago
Hey,
For the moment there are not other methods than disk cache to store the stats file.
But, in order to solve this problem, you can for example share the stats file directory via docker-compose. You can also use google droplet and gaufrette.
if you want to use another File Manager, it must implements the "Tchoulom\ViewCounterBundle\Filesystem\FilesystemInterface"
The service "Tchoulom\ViewCounterBundle\Statistics\Statistics" uses the file Manager in order to save the stats data.
Hope this helps you.
I see, thanks for the info. When are the statistics written to file? After each viewcount? Dont see anything about cron. Hope you can clarify!
The statistics are written to file after viewcount. See the service "Tchoulom\ViewCounterBundle\Counter\AbstractViewCounter" , line 186
There is no cron.
Ok, so basically you dont want to use droplet for this as local storage would perform much better. Writing after every view count requires much i/o
The writing/read system on the disc could indeed be improved. But you can use droplet in your case as mentioned in my previous posts.
For information, the new version 5 offers new features that allow you to have your own statistics storage system.
To use your own statistics storage system, you must:
configure the statistics storage service : https://github.com/tchoulom/ViewCounterBundle/blob/HEAD/Resources/doc/readme/usage-step-1-5.md#step-3-configuration
Your statistics storage service must implement the interface Tchoulom\ViewCounterBundle\Adapter\Storage\StorageAdapterInterface
It is now also possible to avoid the creation of statistical data after each view count: https://github.com/tchoulom/ViewCounterBundle/blob/HEAD/Resources/doc/readme/tools-command-convert-to-stats.md#converts-viewcounter-entities-to-statistical-data
Hope this helps you.
The cron is just perfect. Will test today. Thanks!
I use this plugin inside a docker project. I was wondering if there are any other methods than disk cache to store the stats file? My filesystem is read only. Could i use a google droplet for example in combination with gaufrette?
Hope someone has a tip.