Skip to content

Commit

Permalink
remove monitoring metrics (#266)
Browse files Browse the repository at this point in the history
* remove monitoring metrics

* remove unused counter var

Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
  • Loading branch information
BuckarooBanzay and BuckarooBanzay authored May 4, 2022
1 parent 99b9001 commit b26132a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ read_globals = {
"mesecon", "moretrees",
"unified_inventory", "protector",
"unifieddyes", "digiline_remote",
"monitoring", "drawers", "mg",
"drawers", "mg",
"craftguide", "i3",

-- Only used in technic/machines/MV/lighting.lua (disabled)
Expand Down
28 changes: 0 additions & 28 deletions technic/machines/switching_station_globalstep.lua
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@

local has_monitoring_mod = minetest.get_modpath("monitoring")

local active_switching_stations_metric, switching_stations_usage_metric

if has_monitoring_mod then
active_switching_stations_metric = monitoring.gauge(
"technic_active_switching_stations",
"Number of active switching stations"
)

switching_stations_usage_metric = monitoring.counter(
"technic_switching_stations_usage",
"usage in microseconds cpu time"
)
end

-- the interval between technic_run calls
local technic_run_interval = 1.0
local set_default_timeout = technic.set_default_timeout
Expand Down Expand Up @@ -46,13 +29,9 @@ minetest.register_globalstep(function(dtime)

local now = minetest.get_us_time()

local active_switches = 0

for network_id, network in pairs(technic.active_networks) do
if network.timeout > now and not technic.is_overloaded(network_id) then
-- station active
active_switches = active_switches + 1

if network.skip > 0 then
network.skip = network.skip - 1
else
Expand Down Expand Up @@ -91,13 +70,6 @@ minetest.register_globalstep(function(dtime)
technic.active_networks[network_id] = nil
end
end

if has_monitoring_mod then
local time_usage = minetest.get_us_time() - now
active_switching_stations_metric.set(active_switches)
switching_stations_usage_metric.inc(time_usage)
end

end)

minetest.register_chatcommand("technic_flush_switch_cache", {
Expand Down
2 changes: 1 addition & 1 deletion technic/mod.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name = technic
depends = default, pipeworks, technic_worldgen, basic_materials, moreores
optional_depends = bucket, mesecons, mesecons_mvps, digilines, digiline_remote, unified_inventory, vector_extras, dye, monitoring, craftguide, i3
optional_depends = bucket, mesecons, mesecons_mvps, digilines, digiline_remote, unified_inventory, vector_extras, dye, craftguide, i3

0 comments on commit b26132a

Please sign in to comment.