processone / eturnal

STUN / TURN standalone server

Home Page:https://eturnal.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mod_stats_prometheus: make bucket sizes configurable

sando38 opened this issue · comments

Currently bucket sizes for time and data are hard coded. These values are tailored for Audio/Video use cases, however, TURN is not only used for these scenarios. Therefore, provide a configurational option to define them via the module section, e.g. like this:

mod_stats_prometheus:
  buckets_time: [10, 20, 30, 45, 60, 120, 300]
  buckets_size: [1024, 2048, 4096, 8192] 

-define(SIZE_BUCKETS,
[1024 * 4,
1024 * 32,
1024 * 256,
1024 * 1024,
1024 * 1024 * 4,
1024 * 1024 * 16,
1024 * 1024 * 64,
1024 * 1024 * 256,
1024 * 1024 * 1024]).
-define(TIME_BUCKETS,
[timer:minutes(1) div 1000,
timer:minutes(5) div 1000,
timer:minutes(15) div 1000,
timer:minutes(30) div 1000,
timer:hours(1) div 1000,
timer:hours(2) div 1000,
timer:hours(6) div 1000,
timer:hours(12) div 1000,
timer:hours(24) div 1000]).