Revert "Revert "remove monitoring code and deps""

This reverts commit 48d251a33821a2b6f9f826e6d8fe7ca601e3e903.
This commit is contained in:
Thomas Rudin 2019-04-29 20:49:22 +02:00
parent 8b457ef770
commit 9ca1f1070a
3 changed files with 0 additions and 42 deletions

View File

@ -12,4 +12,3 @@ intllib?
unified_inventory? unified_inventory?
vector_extras? vector_extras?
dye? dye?
monitoring?

View File

@ -4,15 +4,6 @@ local S = technic.getter
local tube_entry = "^pipeworks_tube_connection_metallic.png" local tube_entry = "^pipeworks_tube_connection_metallic.png"
local cable_entry = "^technic_cable_connection_overlay.png" local cable_entry = "^technic_cable_connection_overlay.png"
local has_monitoring = minetest.get_modpath("monitoring")
local metric_dig_count
if has_monitoring then
metric_dig_count = monitoring.counter("technic_quarry_dig_count",
"number of technic quarry digs")
end
minetest.register_craft({ minetest.register_craft({
recipe = { recipe = {
{"technic:carbon_plate", "pipeworks:filter", "technic:composite_plate"}, {"technic:carbon_plate", "pipeworks:filter", "technic:composite_plate"},
@ -144,9 +135,6 @@ local function quarry_handle_purge(pos)
end end
local function quarry_run(pos, node) local function quarry_run(pos, node)
if metric_dig_count ~= nil then
metric_dig_count.inc()
end
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner") local owner = meta:get_string("owner")

View File

@ -4,22 +4,6 @@ technic.networks = {}
technic.cables = {} technic.cables = {}
technic.redundant_warn = {} technic.redundant_warn = {}
local switch_max_range = tonumber(minetest.settings:get("technic.switch_max_range") or "64")
local has_monitoring = minetest.get_modpath("monitoring")
local metric_abm_count
local metric_abm_latency
if has_monitoring then
metric_abm_count = monitoring.counter("technic_switching_station_abm_count",
"number of technic switch abm calls")
metric_abm_latency = monitoring.histogram("technic_switching_station_abm_latency",
"latency of the technic switch abm calls",
{0.001, 0.005, 0.01, 0.02, 0.1, 0.5, 1.0})
end
local mesecons_path = minetest.get_modpath("mesecons") local mesecons_path = minetest.get_modpath("mesecons")
local digilines_path = minetest.get_modpath("digilines") local digilines_path = minetest.get_modpath("digilines")
@ -265,13 +249,6 @@ minetest.register_abm({
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
if not technic.powerctrl_state then return end if not technic.powerctrl_state then return end
local timer
if has_monitoring then
metric_abm_count.inc()
timer = metric_abm_latency.timer()
end
local t0 = minetest.get_us_time() local t0 = minetest.get_us_time()
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local meta1 = nil local meta1 = nil
@ -454,8 +431,6 @@ minetest.register_abm({
minetest.log("warning", "[technic] [+supply] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos)) minetest.log("warning", "[technic] [+supply] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos))
end end
if timer ~= nil then timer.observe() end
return
end end
-- If the PR supply is not enough for the RE demand we will discharge the batteries too -- If the PR supply is not enough for the RE demand we will discharge the batteries too
@ -485,8 +460,6 @@ minetest.register_abm({
minetest.log("warning", "[technic] [-supply] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos)) minetest.log("warning", "[technic] [-supply] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos))
end end
if timer ~= nil then timer.observe() end
return
end end
-- If the PR+BA supply is not enough for the RE demand: Power only the batteries -- If the PR+BA supply is not enough for the RE demand: Power only the batteries
@ -511,8 +484,6 @@ minetest.register_abm({
minetest.log("warning", "[technic] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos)) minetest.log("warning", "[technic] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos))
end end
if timer ~= nil then timer.observe() end
end, end,
}) })