Update version to 0.2.3, add logging for logistic and train statistics, and improve research time estimation
This commit is contained in:
@@ -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",
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user