SSmetrics - Elasticsearch powered metrics viewing

This commit is contained in:
AffectedArc07
2021-08-15 13:00:19 +01:00
parent d03fc7ea1c
commit 2ece3203c2
12 changed files with 97 additions and 0 deletions
+13
View File
@@ -2,6 +2,8 @@
/datum/controller/subsystem
// Metadata; you should define these.
name = "fire codertrain" //name of the subsystem
/// Subsystem ID. Used for when we need a technical name for the SS
var/ss_id = "fire_codertrain_again"
var/init_order = INIT_ORDER_DEFAULT //order of initialization. Higher numbers are initialized first, lower numbers later. Use defines in __DEFINES/subsystems.dm for easy understanding of order.
var/wait = 20 //time to wait (in deciseconds) between each call to fire(). Must be a positive integer.
var/priority = FIRE_PRIORITY_DEFAULT //When mutiple subsystems need to run in the same tick, higher priority subsystems will run first and be given a higher share of the tick before MC_TICK_CHECK triggers a sleep
@@ -227,3 +229,14 @@
if("queued_priority") //editing this breaks things.
return 0
. = ..()
// Returns the metrics for the subsystem.
// This can be overriden on subtypes for variables that could affect tick usage
// Example: ATs on SSair
/datum/controller/subsystem/proc/get_metrics()
SHOULD_CALL_PARENT(TRUE)
var/list/out = list()
out["cost"] = cost
out["tick_usage"] = tick_usage
out["custom"] = list() // Override as needed on child
return out