mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 04:51:32 +01:00
Implements extool's memory profiler (#9051)
* le commit * log da change
This commit is contained in:
@@ -176,7 +176,8 @@ var/list/admin_verbs_server = list(
|
||||
/client/proc/restart_controller,
|
||||
/client/proc/cmd_ss_panic,
|
||||
/client/proc/configure_access_control,
|
||||
/datum/admins/proc/togglehubvisibility //toggles visibility on the BYOND Hub
|
||||
/datum/admins/proc/togglehubvisibility, //toggles visibility on the BYOND Hub
|
||||
/client/proc/dump_memory_usage
|
||||
)
|
||||
var/list/admin_verbs_debug = list(
|
||||
/client/proc/getruntimelog, // allows us to access runtime logs to somebody,
|
||||
@@ -1283,3 +1284,29 @@ var/list/admin_verbs_cciaa = list(
|
||||
|
||||
to_chat(usr, "The sunlight system is disabled.")
|
||||
#endif
|
||||
|
||||
/client/proc/dump_memory_usage()
|
||||
set name = "Dump Server Memory Usage"
|
||||
set category = "Server"
|
||||
|
||||
if (!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
if (alert(usr, "This will momentarily block the server. Proceed?", "Alert", "Yes", "No") != "Yes")
|
||||
return
|
||||
|
||||
var/fname = "[game_id]-[time2text(world.timeofday, "MM-DD-hhmm")].json"
|
||||
|
||||
to_world(SPAN_DANGER("The server will momentarily freeze in 2 seconds!"))
|
||||
log_and_message_admins("has initiated a memory dump into \"[fname]\".", usr)
|
||||
|
||||
sleep(20)
|
||||
|
||||
if (!dump_memory_profile("data/logs/memory/[fname]"))
|
||||
to_chat(usr, SPAN_WARNING("Dumping memory failed at dll call."))
|
||||
return
|
||||
|
||||
if (!fexists("data/logs/memory/[fname]"))
|
||||
to_chat(usr, SPAN_WARNING("File creation failed. Please check to see if the data/logs/memory folder actually exists."))
|
||||
else
|
||||
to_chat(usr, SPAN_NOTICE("Memory dump completed."))
|
||||
|
||||
Reference in New Issue
Block a user