Files
fulpstation/code/__HELPERS/stat_tracking.dm
A miscellaneous Fern f3397e3136 January TGU - First Draft (#879)
* Update beefman.dm

* Update beefman.dm

* xsaxsfvvvvvvvv

* Update shaded_bloodsucker.dm

* yeah that thing

* FUCK you

* Update hunting_contract.dm

* dd

* vdvdfv

* Update monsterhunter_weapons.dm

* Update whiterabbit.dm

* onokkn

* Update monsterhunter_weapons.dm

* Update monsterhunter_weapons.dm

* efe

* Update whiterabbit.dm

* yeaywa

* Update red_rabbit.dmi

* oihop

* Update HunterContract.js

* wonderland.dm

* gs

* dcd

* Update rabbit.dmi

* ass

* fvd

* Update paradox_rabbit.dm

* f

* Update tgstation.dme

* Delete heartbeatmoon.dmi

* shtntb

* sed

* sfe

* Update monsterhunter_weapons.dm

* cdc

* Update wonderland.dm

* dgrd

* wef

* b

* pipkk

* Update hunting_contract.dm

* Update paradox_rabbit.dm

* wr

* Update worn_mask.dmi

* some documenting

* Update areas.dm

* eg

* Update white_rabbit.dm

* Update HunterContract.js

* s

* Update weapons.dmi

* Update weapons.dmi

* Jack in the bomb

* some signals

* ui

* h

* y

* music

* Update wonderlandmusic.ogg

* f

* v

* cleanups

* g

* a

* t

* y

* g

* a

* o

* first commit

* Adding our stuff back in

* k

* Before procs

* proc refs

* carps

* Fixes

* shuttles

* dumb dumb names

* I hate windows I hate windows

* I hate windows I hate windows

* h

* Selenestation has issues

* Update monsterhunter_weapons.dm

* eretics

* Update weapons.dmi

* Update monsterhunter_weapons.dm

* g

* kpop

* r

* m

* grgr

* Update simple_animal_freeze.dm

* Update wonderland_apocalypse.dm

* Update wonderland_apocalypse.dm

* d

* Update fulp_defines.dm

* ff

* Update wonderland.dmm

* Update tgstation.dme

* Update infil_objectives.dm

* Update infil_objectives.dm

* Update monsterhunter_weapons.dm

* Update monsterhunter_event.dm

* Update monsterhunter_event.dm

* Update areas.dm

* Update monsterhunter_event.dm

* Update monsterhunter_weapons.dm

* Step 0, version 2

* step 0.5 - version 2

* step 1 - version 2

* 2.5 version 2

* fix

* Mapping

* okay fine

* more mapping

* uuuuu
hhhh

* fixes

* help me

* hurry

* I'm killing the mf that did access helpers on this map

* Welp, we lost.

* Or did we?

---------

Co-authored-by: SmoSmoSmoSmok <95004236+SmoSmoSmoSmok@users.noreply.github.com>
Co-authored-by: Pepsilawn <reisenrui@gmail.com>
Co-authored-by: SgtHunk <68669754+SgtHunk@users.noreply.github.com>
2023-02-01 03:57:55 -03:00

42 lines
1.2 KiB
Plaintext

// For use with the stopwatch defines
/proc/render_stats(list/stats, user, sort = GLOBAL_PROC_REF(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")
// For use with the set_cost defines
/proc/stat_tracking_export_to_json_later(filename, costs, counts)
if (IsAdminAdvancedProcCall())
return
var/list/output = list()
for (var/key in costs)
output[key] = list(
"cost" = costs[key],
"count" = counts[key],
)
rustg_file_write(json_encode(output), "[GLOB.log_directory]/[filename]")
/proc/stat_tracking_export_to_csv_later(filename, costs, counts)
if (IsAdminAdvancedProcCall())
return
var/list/output = list()
output += "key, cost, count"
for (var/key in costs)
output += "[replacetext(key, ",", "")], [costs[key]], [counts[key]]"
rustg_file_write(output.Join("\n"), "[GLOB.log_directory]/[filename]")