zone-eu / zmta-webadmin

Web admin component for ZoneMTA
42 stars 17 forks source link

Statistics Period configuration #24

Open bengivre opened 3 years ago

bengivre commented 3 years ago

Hello ,

just wondering if there is a way to configure the time frame when visualizing the statistics or to adjust the Timezone of selection in config file or code?

The zmta-webadmin interface counter get reset a some point during the evening (i'm in Canada, EST time ) I would like to know if that is something i can adjust or if those information are cleared from zmta itself ?

So I can have statistics from a full day (24H) on my timezone.

Or maybe, working on a way to keep those data longer (somewhere in the BD ?) and have a way to pick a time-frame like :

Thanks!

andris9 commented 3 years ago

Currently webadmin uses daily "buckets" where day is UTC based. For more detailed numbers at least hourly buckets would be needed. It would work in a way where you always increment the counter of current hour and when you need the stats you calculate the buckets you would need data from, fetch the counters from these buckets and then add the values together to get the final number. Current implementation does not support it though.

bengivre commented 3 years ago

Thanks @andris9 for the detail. Does webadmin pull the data from zone-mta into his own "buckets" or zone-mta push it to webadmin ?

andris9 commented 3 years ago

Counters are updated here and retrieved here. "Bucket" key is year + '/' + month + '/' + day