From 6954fc944f60e869225cdc4706aa2b284b1f2897 Mon Sep 17 00:00:00 2001 From: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Date: Thu, 28 Jan 2021 16:10:02 +0000 Subject: [PATCH] Farie tweaks --- code/controllers/subsystem/profiler.dm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/controllers/subsystem/profiler.dm b/code/controllers/subsystem/profiler.dm index dca67c38c11..418af664d92 100644 --- a/code/controllers/subsystem/profiler.dm +++ b/code/controllers/subsystem/profiler.dm @@ -2,22 +2,24 @@ SUBSYSTEM_DEF(profiler) name = "Profiler" init_order = INIT_ORDER_PROFILER runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY - wait = 3000 + wait = 5 MINUTES flags = SS_NO_TICK_CHECK + /// Time it took to fetch profile data (ms) var/fetch_cost = 0 + /// Time it took to write the file (ms) var/write_cost = 0 /datum/controller/subsystem/profiler/stat_entry() - ..("F:[round(fetch_cost,1)]ms | W:[round(write_cost,1)]ms") + ..("F:[round(fetch_cost, 1)]ms | W:[round(write_cost, 1)]ms") /datum/controller/subsystem/profiler/Initialize() if(!config.auto_profile) StopProfiling() //Stop the early start profiler if we dont want it on in the config + flags |= SS_NO_FIRE return ..() /datum/controller/subsystem/profiler/fire() - if(config.auto_profile) - DumpFile() + DumpFile() /datum/controller/subsystem/profiler/Shutdown() if(config.auto_profile) @@ -35,7 +37,7 @@ SUBSYSTEM_DEF(profiler) // Write the file while also cost tracking /datum/controller/subsystem/profiler/proc/DumpFile() var/timer = TICK_USAGE_REAL - var/current_profile_data = world.Profile(PROFILE_REFRESH,format="json") + var/current_profile_data = world.Profile(PROFILE_REFRESH, format = "json") fetch_cost = MC_AVERAGE(fetch_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer)) CHECK_TICK if(!length(current_profile_data)) //Would be nice to have explicit proc to check this