Commit 529271f
authored
fix: make stats interval and batch connection events configurable (#13)
* fix: make stats interval and batch connection events configurable
DEFAULT_INTERVAL was hardcoded to 10s (10000ms), causing all connected
clients to send POST /v1/stats every 10 seconds. Changed default to 30s
and made it configurable via STATS_INTERVAL_MS env var. This reduces API
load by 3x immediately.
Also changed BATCH_CONNECTION_REQUESTS default to True so the SDK bundles
multiple connection events per request instead of one request per event.
Both values are returned to the SDK via the /v1/initialize response.
* fix: keep default stats interval at 10s, use env var to override
Keep DEFAULT_INTERVAL at 10000ms (original value) to avoid changing
existing behavior. DevOps can set STATS_INTERVAL_MS to increase it
(e.g. 30000 for 30s) when needed.1 parent 5aee081 commit 529271f
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
0 commit comments