From de1a7ad87b6d3c0dd0178e83c397e2c09a356b65 Mon Sep 17 00:00:00 2001 From: Lucy Date: Sat, 28 Sep 2024 18:36:52 -0400 Subject: [PATCH] Disable profiler JSON sorting --- monkestation/code/controllers/subsystem/profiler.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/monkestation/code/controllers/subsystem/profiler.dm b/monkestation/code/controllers/subsystem/profiler.dm index f3445536588d..2497f0b3ce7a 100644 --- a/monkestation/code/controllers/subsystem/profiler.dm +++ b/monkestation/code/controllers/subsystem/profiler.dm @@ -9,8 +9,8 @@ /datum/controller/subsystem/profiler/proc/DumpFile() var/timer = TICK_USAGE_REAL - var/list/current_profile_data = world.Profile(PROFILE_REFRESH, format = "json") - current_profile_data = json_decode(current_profile_data) // yes this is stupid but this gets us a list in a non-awful format + var/current_profile_data = world.Profile(PROFILE_REFRESH, format = "json") + //current_profile_data = json_decode(current_profile_data) // yes this is stupid but this gets us a list in a non-awful format var/current_sendmaps_data = world.Profile(PROFILE_REFRESH, type = "sendmaps", format = "json") fetch_cost = MC_AVERAGE(fetch_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer)) CHECK_TICK @@ -18,9 +18,9 @@ if(!length(current_profile_data)) //Would be nice to have explicit proc to check this stack_trace("Warning, profiling stopped manually before dump.") - timer = TICK_USAGE_REAL + /*timer = TICK_USAGE_REAL sortTim(current_profile_data, GLOBAL_PROC_REF(sort_overtime_dsc)) - sort_cost = MC_AVERAGE(sort_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer)) + sort_cost = MC_AVERAGE(sort_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))*/ var/timestamp = time2text(world.timeofday, "YYYY-MM-DD_hh-mm-ss") var/prof_file = "[GLOB.log_directory]/profiler/profiler-[timestamp].json" @@ -29,7 +29,7 @@ var/sendmaps_file = "[GLOB.log_directory]/profiler/sendmaps-[timestamp].json" timer = TICK_USAGE_REAL - rustg_file_write(json_encode(current_profile_data), prof_file) + rustg_file_write(current_profile_data, prof_file) rustg_file_write(current_sendmaps_data, sendmaps_file) write_cost = MC_AVERAGE(write_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))