From e0a910215bfbb6353a728a2e180bc1d6a9120f2d Mon Sep 17 00:00:00 2001 From: Wildkins Date: Sat, 15 Jul 2023 13:27:23 -0400 Subject: [PATCH] SendMaps profiling (#16732) --- code/controllers/subsystems/profiler.dm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/code/controllers/subsystems/profiler.dm b/code/controllers/subsystems/profiler.dm index 05ce38aed72..c069f58d2cc 100644 --- a/code/controllers/subsystems/profiler.dm +++ b/code/controllers/subsystems/profiler.dm @@ -29,6 +29,12 @@ var/datum/controller/subsystem/profiler/SSprofiler ..() +/datum/controller/subsystem/profiler/Shutdown() + . = ..() + if (config.profiler_is_enabled) + DumpData() + world.Profile(PROFILE_CLEAR, type="sendmaps") + /datum/controller/subsystem/profiler/fire() . = world.timeofday @@ -36,6 +42,7 @@ var/datum/controller/subsystem/profiler/SSprofiler last_fire_rt = . next_restart = world.time + restart_period world.Profile(PROFILE_START) + world.Profile(PROFILE_START, type="sendmaps") if (. - last_fire_rt > threshold) DumpData() @@ -49,8 +56,10 @@ var/datum/controller/subsystem/profiler/SSprofiler admin_notice(SPAN_DANGER("Profiler: dump profile after CPU spike."), R_SERVER|R_DEV) var/name = "[game_id]_[time2text(world.timeofday, "hh-mm-ss")]" - text2file(world.Profile(0, "json"), "data/logs/profiler/[game_id]/[name].json") + text2file(world.Profile(PROFILE_REFRESH, "json"), "data/logs/profiler/[game_id]/[name].json") + text2file(world.Profile(PROFILE_REFRESH, type = "sendmaps", format = "json"), "data/logs/profiler/[game_id]/[name]_sendmaps.json") /datum/controller/subsystem/profiler/proc/RestartProfiler() world.Profile(PROFILE_CLEAR) + world.Profile(PROFILE_CLEAR, type="sendmaps") next_restart = world.time + restart_period