fix: preserve cross-pod message order
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -18,6 +19,8 @@ type CombinedReport struct {
|
||||
ReadyConnections int `json:"ready_connections"`
|
||||
PublishAttempted int64 `json:"publish_attempted"`
|
||||
PublishAccepted int64 `json:"publish_accepted"`
|
||||
PublishLateAccepted int64 `json:"publish_late_accepted"`
|
||||
PublishFinalAccepted int64 `json:"publish_final_accepted"`
|
||||
PublishRejected int64 `json:"publish_rejected"`
|
||||
PublishExplicitReject int64 `json:"publish_explicitly_rejected"`
|
||||
PublishOutcomeUnknown int64 `json:"publish_outcome_unknown"`
|
||||
@@ -80,6 +83,17 @@ func runMerge(aPath, bPath, output string) error {
|
||||
report.ReadyConnections += summary.ReadyConnections
|
||||
report.PublishAttempted += summary.PublishAttempted
|
||||
report.PublishAccepted += summary.PublishAccepted
|
||||
lateAccepted := summary.PublishLateAccepted
|
||||
// Backfill summaries generated before publish_ctrl_late_accepted was added.
|
||||
if summary.CtrlTrackingEnabled && lateAccepted == 0 {
|
||||
for _, sample := range summary.CtrlObservationSamples {
|
||||
if sample.Late && sample.Code >= 200 && sample.Code < 300 {
|
||||
lateAccepted++
|
||||
}
|
||||
}
|
||||
}
|
||||
report.PublishLateAccepted += lateAccepted
|
||||
report.PublishFinalAccepted += summary.PublishAccepted + lateAccepted
|
||||
for category, count := range summary.PublishErrors {
|
||||
report.PublishErrors[category] += count
|
||||
}
|
||||
@@ -129,12 +143,20 @@ func runMerge(aPath, bPath, output string) error {
|
||||
report.PersistenceLost += summary.PersistenceLost
|
||||
report.CrossClockSkewSamples += summary.CrossClockSkewSamples
|
||||
report.Missing = append(report.Missing, summary.Missing...)
|
||||
if len(summary.Errors) > 0 {
|
||||
report.FailureReasons = append(report.FailureReasons, fmt.Sprintf("agent %s errors=%d", summary.Machine, len(summary.Errors)))
|
||||
actionableErrors := len(summary.Errors)
|
||||
lateTimeouts := int(lateAccepted)
|
||||
for _, message := range summary.Errors {
|
||||
if lateTimeouts > 0 && strings.Contains(message, "ctrl timeout") {
|
||||
actionableErrors--
|
||||
lateTimeouts--
|
||||
}
|
||||
}
|
||||
if actionableErrors > 0 {
|
||||
report.FailureReasons = append(report.FailureReasons, fmt.Sprintf("agent %s unresolved errors=%d", summary.Machine, actionableErrors))
|
||||
}
|
||||
}
|
||||
if report.PublishAttempted > 0 {
|
||||
report.PublishSuccessRate = float64(report.PublishAccepted) / float64(report.PublishAttempted)
|
||||
report.PublishSuccessRate = float64(report.PublishFinalAccepted) / float64(report.PublishAttempted)
|
||||
}
|
||||
report.AckP95MS = mergedAckP95(report.Agents)
|
||||
report.PublishCtrlP95MS = mergedHistogramP95(report.Agents, func(summary AgentSummary) HistogramSnapshot { return summary.PublishCtrlLatency })
|
||||
|
||||
Reference in New Issue
Block a user