fix(platform): harden queries and batch vehicle search
This commit is contained in:
@@ -1113,6 +1113,9 @@ func TestHandlerSourceReadiness(t *testing.T) {
|
||||
if body.Data.PlatformRelease != "platform-source-test" {
|
||||
t.Fatalf("source readiness should expose runtime release, got %+v", body.Data)
|
||||
}
|
||||
if body.Data.TotalVehicles != body.Data.BoundVehicles+body.Data.IdentityRequiredVehicles {
|
||||
t.Fatalf("source readiness vehicle identity population should reconcile, got %+v", body.Data)
|
||||
}
|
||||
if len(body.Data.Sources) < len(canonicalVehicleProtocols) {
|
||||
t.Fatalf("source readiness should expose canonical protocol slots, got %+v", body.Data.Sources)
|
||||
}
|
||||
|
||||
@@ -942,13 +942,15 @@ type MissingSourceStat struct {
|
||||
}
|
||||
|
||||
type SourceReadinessPlan struct {
|
||||
TotalVehicles int `json:"totalVehicles"`
|
||||
OnlineVehicles int `json:"onlineVehicles"`
|
||||
KafkaLag *int `json:"kafkaLag"`
|
||||
ActiveConnections *int `json:"activeConnections"`
|
||||
RedisOnlineKeys *int `json:"redisOnlineKeys"`
|
||||
PlatformRelease string `json:"platformRelease"`
|
||||
Sources []SourceReadinessRow `json:"sources"`
|
||||
TotalVehicles int `json:"totalVehicles"`
|
||||
BoundVehicles int `json:"boundVehicles"`
|
||||
IdentityRequiredVehicles int `json:"identityRequiredVehicles"`
|
||||
OnlineVehicles int `json:"onlineVehicles"`
|
||||
KafkaLag *int `json:"kafkaLag"`
|
||||
ActiveConnections *int `json:"activeConnections"`
|
||||
RedisOnlineKeys *int `json:"redisOnlineKeys"`
|
||||
PlatformRelease string `json:"platformRelease"`
|
||||
Sources []SourceReadinessRow `json:"sources"`
|
||||
}
|
||||
|
||||
type SourceReadinessRow struct {
|
||||
|
||||
@@ -262,13 +262,15 @@ func buildSourceReadinessPlan(summary VehicleServiceSummary, health OpsHealth, q
|
||||
rows = append(rows, row)
|
||||
}
|
||||
return SourceReadinessPlan{
|
||||
TotalVehicles: summary.TotalVehicles,
|
||||
OnlineVehicles: summary.OnlineVehicles,
|
||||
KafkaLag: health.KafkaLag,
|
||||
ActiveConnections: health.ActiveConnections,
|
||||
RedisOnlineKeys: health.RedisOnlineKeys,
|
||||
PlatformRelease: health.Runtime.PlatformRelease,
|
||||
Sources: rows,
|
||||
TotalVehicles: summary.TotalVehicles,
|
||||
BoundVehicles: summary.BoundVehicles,
|
||||
IdentityRequiredVehicles: summary.IdentityRequiredVehicles,
|
||||
OnlineVehicles: summary.OnlineVehicles,
|
||||
KafkaLag: health.KafkaLag,
|
||||
ActiveConnections: health.ActiveConnections,
|
||||
RedisOnlineKeys: health.RedisOnlineKeys,
|
||||
PlatformRelease: health.Runtime.PlatformRelease,
|
||||
Sources: rows,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user