Skip to content

Commit b26132a

Browse files
remove monitoring metrics (#266)
* remove monitoring metrics * remove unused counter var Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
1 parent 99b9001 commit b26132a

File tree

3 files changed

+2
-30
lines changed

3 files changed

+2
-30
lines changed

.luacheckrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ read_globals = {
2626
"mesecon", "moretrees",
2727
"unified_inventory", "protector",
2828
"unifieddyes", "digiline_remote",
29-
"monitoring", "drawers", "mg",
29+
"drawers", "mg",
3030
"craftguide", "i3",
3131

3232
-- Only used in technic/machines/MV/lighting.lua (disabled)

technic/machines/switching_station_globalstep.lua

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
2-
local has_monitoring_mod = minetest.get_modpath("monitoring")
3-
4-
local active_switching_stations_metric, switching_stations_usage_metric
5-
6-
if has_monitoring_mod then
7-
active_switching_stations_metric = monitoring.gauge(
8-
"technic_active_switching_stations",
9-
"Number of active switching stations"
10-
)
11-
12-
switching_stations_usage_metric = monitoring.counter(
13-
"technic_switching_stations_usage",
14-
"usage in microseconds cpu time"
15-
)
16-
end
17-
181
-- the interval between technic_run calls
192
local technic_run_interval = 1.0
203
local set_default_timeout = technic.set_default_timeout
@@ -46,13 +29,9 @@ minetest.register_globalstep(function(dtime)
4629

4730
local now = minetest.get_us_time()
4831

49-
local active_switches = 0
50-
5132
for network_id, network in pairs(technic.active_networks) do
5233
if network.timeout > now and not technic.is_overloaded(network_id) then
5334
-- station active
54-
active_switches = active_switches + 1
55-
5635
if network.skip > 0 then
5736
network.skip = network.skip - 1
5837
else
@@ -91,13 +70,6 @@ minetest.register_globalstep(function(dtime)
9170
technic.active_networks[network_id] = nil
9271
end
9372
end
94-
95-
if has_monitoring_mod then
96-
local time_usage = minetest.get_us_time() - now
97-
active_switching_stations_metric.set(active_switches)
98-
switching_stations_usage_metric.inc(time_usage)
99-
end
100-
10173
end)
10274

10375
minetest.register_chatcommand("technic_flush_switch_cache", {

technic/mod.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
name = technic
22
depends = default, pipeworks, technic_worldgen, basic_materials, moreores
3-
optional_depends = bucket, mesecons, mesecons_mvps, digilines, digiline_remote, unified_inventory, vector_extras, dye, monitoring, craftguide, i3
3+
optional_depends = bucket, mesecons, mesecons_mvps, digilines, digiline_remote, unified_inventory, vector_extras, dye, craftguide, i3

0 commit comments

Comments
 (0)