From 9912961f9b7a2e1cd55fc799b5baed896fbcfc39 Mon Sep 17 00:00:00 2001 From: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Date: Fri, 14 Jun 2024 05:54:47 +0000 Subject: [PATCH] Adds a config to change the interval profiler information gets saved (#83849) ## About The Pull Request As title says ## Why It's Good For The Game Important for server operation --------- Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com> --- code/controllers/configuration/entries/general.dm | 3 +++ code/controllers/subsystem/profiler.dm | 1 + config/config.txt | 3 +++ 3 files changed, 7 insertions(+) diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index 69b3bbcad64..964459aea68 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -650,6 +650,9 @@ /datum/config_entry/flag/auto_profile +/datum/config_entry/number/profiler_interval + default = 300 SECONDS + /datum/config_entry/number/drift_dump_threshold default = 4 SECONDS diff --git a/code/controllers/subsystem/profiler.dm b/code/controllers/subsystem/profiler.dm index 46d5b0fd57b..d149bc5e77c 100644 --- a/code/controllers/subsystem/profiler.dm +++ b/code/controllers/subsystem/profiler.dm @@ -16,6 +16,7 @@ SUBSYSTEM_DEF(profiler) StartProfiling() else StopProfiling() //Stop the early start profiler + wait = CONFIG_GET(number/profiler_interval) return SS_INIT_SUCCESS /datum/controller/subsystem/profiler/OnConfigLoad() diff --git a/config/config.txt b/config/config.txt index 09824fed555..6252c3bae65 100644 --- a/config/config.txt +++ b/config/config.txt @@ -482,6 +482,9 @@ DEFAULT_VIEW_SQUARE 15x15 ## Enable automatic profiling - Byond 513.1506 and newer only. #AUTO_PROFILE +## Determines the interval between each saved profiler snapshot (in deciseconds). +#PROFILER_INTERVAL 3000 + ## Threshold (in deciseconds) for real time between ticks before we start dumping profiles DRIFT_DUMP_THRESHOLD 40