Mercurial > prosody-hg
comparison core/statsmanager.lua @ 10884:6992c4be1a19
core.statsmanager: Allow passing a config table trough measure
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 04 Jan 2019 07:00:44 +0100 |
| parents | 25f80afb1631 |
| children | 9a3ebdd65f9c |
comparison
equal
deleted
inserted
replaced
| 10883:d75d805c852f | 10884:6992c4be1a19 |
|---|---|
| 58 local latest_stats = {}; | 58 local latest_stats = {}; |
| 59 local changed_stats = {}; | 59 local changed_stats = {}; |
| 60 local stats_extra = {}; | 60 local stats_extra = {}; |
| 61 | 61 |
| 62 if stats then | 62 if stats then |
| 63 function measure(type, name) | 63 function measure(type, name, conf) |
| 64 local f = assert(stats[type], "unknown stat type: "..type); | 64 local f = assert(stats[type], "unknown stat type: "..type); |
| 65 return f(name); | 65 return f(name, conf); |
| 66 end | 66 end |
| 67 | 67 |
| 68 if stats_interval then | 68 if stats_interval then |
| 69 log("debug", "Statistics enabled using %s provider, collecting every %d seconds", stats_provider_name, stats_interval); | 69 log("debug", "Statistics enabled using %s provider, collecting every %d seconds", stats_provider_name, stats_interval); |
| 70 | 70 |
