Private
Public Access
1
0

Update version to 0.2.3, add logging for logistic and train statistics, and improve research time estimation

This commit is contained in:
Jan Grießhaber
2026-01-04 11:05:07 +01:00
parent a44d27c386
commit 4b10091d1a
4 changed files with 8 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "factorio-metrics-exporter", "name": "factorio-metrics-exporter",
"version": "0.2.2", "version": "0.2.3",
"title": "Prometheus Metrics Exporter", "title": "Prometheus Metrics Exporter",
"author": "Jan Grießhaber", "author": "Jan Grießhaber",
"contact": "jan@griesshaber.systems", "contact": "jan@griesshaber.systems",

View File

@@ -36,6 +36,8 @@ function SendLogisticStats()
local returnParts = {} local returnParts = {}
returnParts[#returnParts+1] = GetAllLogisticGrids() returnParts[#returnParts+1] = GetAllLogisticGrids()
returnParts[#returnParts+1] = GetLogisticNetworkContents() returnParts[#returnParts+1] = GetLogisticNetworkContents()
log("Table size logistics "..table_size(returnParts))
log("Sending logistics")
--local send = GetAllLogisticGrids().."\n"..GetLogisticNetworkContents() --local send = GetAllLogisticGrids().."\n"..GetLogisticNetworkContents()
helpers.send_udp(udpAddress,table.concat(returnParts,"\n"),serverIndex) helpers.send_udp(udpAddress,table.concat(returnParts,"\n"),serverIndex)
end end

View File

@@ -46,6 +46,8 @@ function GetEstimatedResearchTime()
local remainingUnits = remainingPercentage*researchTotalCost local remainingUnits = remainingPercentage*researchTotalCost
local estimatedSeconds = remainingUnits/totalSpeed local estimatedSeconds = remainingUnits/totalSpeed
log("Remaining Perc: %d\nCost: %d\nSpeed: %d\nRem Units: %d\n")
local returnSpeed = "---research-speed---\n"..totalSpeed.."\n" local returnSpeed = "---research-speed---\n"..totalSpeed.."\n"
local returnTime = "---research-time---\n"..estimatedSeconds.."\n" local returnTime = "---research-time---\n"..estimatedSeconds.."\n"
local returnNameID = "---research-info---\n"..researchName.."\n" local returnNameID = "---research-info---\n"..researchName.."\n"

View File

@@ -255,8 +255,11 @@ function SendTrainStats()
returnParts[#returnParts+1] = GetTrainTotalKills() returnParts[#returnParts+1] = GetTrainTotalKills()
returnParts[#returnParts+1] = GetTrainStates() returnParts[#returnParts+1] = GetTrainStates()
returnParts[#returnParts+1] = GetTrainStatistics() returnParts[#returnParts+1] = GetTrainStatistics()
helpers.send_udp(udpAddress,table.concat(returnParts,"\n"),serverIndex)
returnParts = {}
returnParts[#returnParts+1] = GetTrainsInDepot() returnParts[#returnParts+1] = GetTrainsInDepot()
returnParts[#returnParts+1] = GetTrainTripStats() returnParts[#returnParts+1] = GetTrainTripStats()
log("Sending Train statistics")
helpers.send_udp(udpAddress,table.concat(returnParts,"\n"),serverIndex) helpers.send_udp(udpAddress,table.concat(returnParts,"\n"),serverIndex)
end end
end end