martinberlin / cale-integrations

CALE configurator to add APIs to your epaper screens - PHP/Symfony 4.4
https://cale.es
MIT License
6 stars 0 forks source link

99/99 Add statistics #6

Closed martinberlin closed 4 years ago

martinberlin commented 4 years ago

For starters: Add a very general hit counter at Screen level to count total hits per screen render. CALE-hitCounter

The preview option should sent a ?preview=1 per querystring GET to signalize the App that we are not counting this as a hit. It should count only hits coming without the preview signal.

After this is done, the done counter can be set to 40/100, and then we will implement a daily Statistics per Screen. Very simple like:

ScreenId | Date (UTC) | hits 1, 2020-02-18 , 100

martinberlin commented 4 years ago

I'm currently brainstorming what would be the best way to add statistics to this in a very easy but powerful fashion. One of the ideas that is sounding with more strength is the usual streamlogging. The logger will save only visits to the image, not to the HTML. We are planning to log here only device request, we have little interest right now to log absolutely everything and there is already in place a hits counter for the Screens.

IDEA A Every row represents a visit

user_id | screen_id | timestamp (visit) | IPaddress

Any delete to Screen should also cascade delete all the related entries in this table automatically. Same with User.

IDEA B Log only per date | hour keeping only last timestamp

martinberlin commented 4 years ago

Basic statistics are live. New issue for further updates