Software /
code /
prosody
Comparison
core/statsmanager.lua @ 11506:9a3ebdd65f9c
core.statsmanager: Cover util.statistics work in processing measurement
Zash> Btw, this conditional and loop, shouldn't it be covered by the timing measurement?
Zash> Isn't that where all the util.statistics work is done?
MattJ> Yeah, it should
Zash> ("the", but there's two ... which one‽)
MattJ> Yeah... not sure :)
MattJ> Processing I guess
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 06 Apr 2021 23:23:28 +0200 |
parent | 10884:6992c4be1a19 |
child | 11515:10d13e0554f9 |
comparison
equal
deleted
inserted
replaced
11505:61d38c4b749d | 11506:9a3ebdd65f9c |
---|---|
75 local mark_collection_done = mark_collection_start(); | 75 local mark_collection_done = mark_collection_start(); |
76 fire_event("stats-update"); | 76 fire_event("stats-update"); |
77 mark_collection_done(); | 77 mark_collection_done(); |
78 | 78 |
79 if stats.get_stats then | 79 if stats.get_stats then |
80 local mark_processing_done = mark_processing_start(); | |
80 changed_stats, stats_extra = {}, {}; | 81 changed_stats, stats_extra = {}, {}; |
81 for stat_name, getter in pairs(stats.get_stats()) do | 82 for stat_name, getter in pairs(stats.get_stats()) do |
82 -- luacheck: ignore 211/type | 83 -- luacheck: ignore 211/type |
83 local type, value, extra = getter(); | 84 local type, value, extra = getter(); |
84 local old_value = latest_stats[stat_name]; | 85 local old_value = latest_stats[stat_name]; |
88 end | 89 end |
89 if extra then | 90 if extra then |
90 stats_extra[stat_name] = extra; | 91 stats_extra[stat_name] = extra; |
91 end | 92 end |
92 end | 93 end |
93 local mark_processing_done = mark_processing_start(); | |
94 fire_event("stats-updated", { stats = latest_stats, changed_stats = changed_stats, stats_extra = stats_extra }); | 94 fire_event("stats-updated", { stats = latest_stats, changed_stats = changed_stats, stats_extra = stats_extra }); |
95 mark_processing_done(); | 95 mark_processing_done(); |
96 end | 96 end |
97 return stats_interval; | 97 return stats_interval; |
98 end | 98 end |