Skip to content

Commit

Permalink
Disable profiler JSON sorting (#3601)
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy authored Oct 3, 2024
1 parent 96d4644 commit e2995c4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions monkestation/code/controllers/subsystem/profiler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@

/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

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"
Expand All @@ -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))

Expand Down

0 comments on commit e2995c4

Please # to comment.