Skip to content

Commit

Permalink
tweak(prometheus): adds more metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Filatelele authored Apr 23, 2024
1 parent 2c92ad5 commit e4186b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/__defines/prometheus.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#define PROM_SUBSYSTEM_TICK_OVERRUN "subsystem_tick_overrun_ratio"
#define PROM_RUNTIMES "runtimes"
#define PROM_TOTAL_PLAYERS "players_total"
#define PROM_TOTAL_LIVING "players_living_total"
#define PROM_WIDESCREEN_PLAYERS "players_with_widescreen"
#define PROM_GC_QUEUED "gc_queued_total"
#define PROM_GC_HARD_DELS "gc_hard_dels"
#define PROM_GC_COLLECTED "gc_collected"
Expand Down
10 changes: 10 additions & 0 deletions code/controllers/subsystems/prometheus.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ SUBSYSTEM_DEF(prometheus)

// Players
rustg_prom_gauge_int_set(PROM_TOTAL_PLAYERS, length(GLOB.player_list), null)
var/living_counter = 0
var/widescreen_counter = 0
for(var/client/client in GLOB.clients)
if(client.get_preference_value("WIDESCREEN") == GLOB.PREF_YES)
widescreen_counter++
if(!client.mob?.is_ooc_dead())
living_counter++

rustg_prom_gauge_int_set(PROM_TOTAL_LIVING, living_counter, null)
rustg_prom_gauge_int_set(PROM_WIDESCREEN_PLAYERS, widescreen_counter, null)

// Subsystems
for(var/datum/controller/subsystem/S in Master.subsystems)
Expand Down

0 comments on commit e4186b1

Please sign in to comment.