mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-03-31 02:02:54 +08:00
fix: Enhance session metrics logging to include party member species and username
This commit is contained in:
parent
28c279c36d
commit
400cb28ee3
@ -86,6 +86,7 @@ func ProcessSessionMetrics(save defs.SessionSaveData, username string) {
|
||||
}
|
||||
|
||||
if save.WaveIndex == 1 {
|
||||
party := ""
|
||||
for i := 0; i < len(save.Party); i++ {
|
||||
partyMember, ok := save.Party[i].(map[string]interface{})
|
||||
if !ok {
|
||||
@ -98,15 +99,16 @@ func ProcessSessionMetrics(save defs.SessionSaveData, username string) {
|
||||
formIndex = fmt.Sprintf("%d", formIdx)
|
||||
}
|
||||
|
||||
species, ok := partyMember["Species"].(int)
|
||||
species, ok := partyMember["species"].(int)
|
||||
if !ok {
|
||||
log.Printf("invalid type for Species at index %d", i)
|
||||
continue
|
||||
}
|
||||
|
||||
key := fmt.Sprintf("%d-%s", species, formIndex)
|
||||
log.Printf("incremented starter %s", key)
|
||||
party += key + ","
|
||||
starterCounter.WithLabelValues(key).Inc()
|
||||
}
|
||||
log.Printf("Incremented starters %s count for %s", party, username)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user