SSoverlay improvements and tweaks (#32371)
* Overlay per-type cost logging. Overlays will now log how long each type took to process. Changed up how overlays was done to account for the fact its a queue and not a processor. (it was using almost none of the processing subsystem framework) Made the overlay loop faster by making it not cut the list until the end. Added a simple generic benchmark stat tracking system. I don't know how much overhead this adds to overlays. i may put it behind testing or something, but i do want to test this on the serbers to get some stats. * Removes flush() as it was creating race conditions * Use ref * text2file * Atoms added as an overlay will have their pending overlays compiled before being converted to an appearance
This commit is contained in:
committed by
CitadelStationBot
parent
70e9eeb8fd
commit
2d8fc6de61
@@ -0,0 +1,13 @@
|
||||
/proc/render_stats(list/stats, user, sort = /proc/cmp_generic_stat_item_time)
|
||||
sortTim(stats, sort, TRUE)
|
||||
|
||||
var/list/lines = list()
|
||||
|
||||
for (var/entry in stats)
|
||||
var/list/data = stats[entry]
|
||||
lines += "[entry] => [num2text(data[STAT_ENTRY_TIME], 10)]ms ([data[STAT_ENTRY_COUNT]]) (avg:[num2text(data[STAT_ENTRY_TIME]/(data[STAT_ENTRY_COUNT] || 1), 99)])"
|
||||
|
||||
if (user)
|
||||
user << browse("<ol><li>[lines.Join("</li><li>")]</li></ol>", "window=[url_encode("stats:[REF(stats)]")]")
|
||||
|
||||
. = lines.Join("\n")
|
||||
Reference in New Issue
Block a user