Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve train metrics setting #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ require("research")
bucket_settings = train_buckets(settings.startup["graftorio2-train-histogram-buckets"].value)
nth_tick = settings.startup["graftorio2-nth-tick"].value
server_save = settings.startup["graftorio2-server-save"].value
disable_train_stats = settings.startup["graftorio2-disable-train-stats"].value

gauge_tick = prometheus.gauge("factorio_tick", "game tick")
gauge_connected_player_count = prometheus.gauge("factorio_connected_player_count", "connected players")
Expand Down Expand Up @@ -140,7 +139,9 @@ script.on_init(function()
script.on_event(defines.events.on_player_kicked, register_events_players)
script.on_event(defines.events.on_player_banned, register_events_players)


-- train envents
disable_train_stats = settings.global["graftorio2-disable-train-stats"].value
if not disable_train_stats then
script.on_event(defines.events.on_train_changed_state, register_events_train)
end
Expand Down Expand Up @@ -176,6 +177,7 @@ script.on_load(function()
script.on_event(defines.events.on_player_banned, register_events_players)

-- train events
disable_train_stats = settings.global["graftorio2-disable-train-stats"].value
if not disable_train_stats then
script.on_event(defines.events.on_train_changed_state, register_events_train)
end
Expand Down
4 changes: 2 additions & 2 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ data:extend({
{
type = "bool-setting",
name = "graftorio2-disable-train-stats",
setting_type = "startup",
default_value = false,
setting_type = "runtime-global",
default_value = true,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't change the default

allow_blank = false,
},
})