fix(go): collapse gb32960 auxiliary snapshot
This commit is contained in:
@@ -482,14 +482,19 @@ func normalizeGB32960RealtimeParsed(parsed map[string]any) {
|
||||
}
|
||||
for _, unit := range units {
|
||||
unitMap, ok := unit.(map[string]any)
|
||||
if !ok || strings.TrimSpace(strconvAny(unitMap["name"])) != "gd_fc_stack" {
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
value, ok := unitMap["value"].(map[string]any)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
collapseGDFCStackValue(value)
|
||||
switch strings.TrimSpace(strconvAny(unitMap["name"])) {
|
||||
case "gd_fc_stack":
|
||||
collapseGDFCStackValue(value)
|
||||
case "gd_fc_auxiliary":
|
||||
collapseGDFCAuxiliaryValue(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -528,6 +533,20 @@ func isGDFCStackFragmentField(key string) bool {
|
||||
}
|
||||
}
|
||||
|
||||
func collapseGDFCAuxiliaryValue(value map[string]any) {
|
||||
subsystems, ok := asAnySlice(value["subsystems"])
|
||||
if !ok || len(subsystems) == 0 {
|
||||
return
|
||||
}
|
||||
latest := subsystems[len(subsystems)-1]
|
||||
subsystem, ok := latest.(map[string]any)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
value["subsystem_count"] = 1
|
||||
value["subsystems"] = []any{cloneMap(subsystem)}
|
||||
}
|
||||
|
||||
func fieldTimes(fields map[string]any, eventMS int64) map[string]int64 {
|
||||
out := make(map[string]int64, len(fields))
|
||||
for key := range fields {
|
||||
|
||||
Reference in New Issue
Block a user