test: support staged pressure connection counts
This commit is contained in:
@@ -173,7 +173,8 @@ func runAgent(ctx context.Context, cfg *Config, manifest *Manifest, machine, coo
|
|||||||
}
|
}
|
||||||
base := AgentSummary{
|
base := AgentSummary{
|
||||||
RunID: start.RunID, Scenario: start.Scenario, Machine: machine, StartedAt: startedAt,
|
RunID: start.RunID, Scenario: start.Scenario, Machine: machine, StartedAt: startedAt,
|
||||||
LoadEndedAt: loadEndedAt, FinishedAt: time.Now().UTC(), ReadyConnections: len(run.clients),
|
LoadEndedAt: loadEndedAt, FinishedAt: time.Now().UTC(), ExpectedConnections: cfg.UsersPerMachine,
|
||||||
|
ReadyConnections: len(run.clients),
|
||||||
PublishAttempted: run.attempted.Load(), PublishAccepted: int64(len(local)), PublishRejected: run.rejected.Load(),
|
PublishAttempted: run.attempted.Load(), PublishAccepted: int64(len(local)), PublishRejected: run.rejected.Load(),
|
||||||
PublishErrors: run.publishErrorCounts(),
|
PublishErrors: run.publishErrorCounts(),
|
||||||
AckLatency: run.ack.Snapshot(), AcceptedLocal: local,
|
AckLatency: run.ack.Snapshot(), AcceptedLocal: local,
|
||||||
|
|||||||
@@ -10,33 +10,34 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CombinedReport struct {
|
type CombinedReport struct {
|
||||||
RunID string `json:"run_id"`
|
RunID string `json:"run_id"`
|
||||||
Scenario string `json:"scenario"`
|
Scenario string `json:"scenario"`
|
||||||
GeneratedAt time.Time `json:"generated_at"`
|
GeneratedAt time.Time `json:"generated_at"`
|
||||||
Agents []AgentSummary `json:"agents"`
|
Agents []AgentSummary `json:"agents"`
|
||||||
ReadyConnections int `json:"ready_connections"`
|
ExpectedConnections int `json:"expected_connections"`
|
||||||
PublishAttempted int64 `json:"publish_attempted"`
|
ReadyConnections int `json:"ready_connections"`
|
||||||
PublishAccepted int64 `json:"publish_accepted"`
|
PublishAttempted int64 `json:"publish_attempted"`
|
||||||
PublishRejected int64 `json:"publish_rejected"`
|
PublishAccepted int64 `json:"publish_accepted"`
|
||||||
PublishErrors map[string]int64 `json:"publish_errors,omitempty"`
|
PublishRejected int64 `json:"publish_rejected"`
|
||||||
PublishSuccessRate float64 `json:"publish_success_rate"`
|
PublishErrors map[string]int64 `json:"publish_errors,omitempty"`
|
||||||
AckP95MS float64 `json:"ack_p95_ms"`
|
PublishSuccessRate float64 `json:"publish_success_rate"`
|
||||||
DeliveryP95MS float64 `json:"delivery_p95_ms"`
|
AckP95MS float64 `json:"ack_p95_ms"`
|
||||||
ExpectedDeliveries int64 `json:"expected_deliveries"`
|
DeliveryP95MS float64 `json:"delivery_p95_ms"`
|
||||||
ReceivedDeliveries int64 `json:"received_deliveries"`
|
ExpectedDeliveries int64 `json:"expected_deliveries"`
|
||||||
RealtimeLost int64 `json:"realtime_lost"`
|
ReceivedDeliveries int64 `json:"received_deliveries"`
|
||||||
RealtimeLostStored int64 `json:"realtime_lost_but_persisted"`
|
RealtimeLost int64 `json:"realtime_lost"`
|
||||||
ArrivalRate float64 `json:"arrival_rate"`
|
RealtimeLostStored int64 `json:"realtime_lost_but_persisted"`
|
||||||
LossRate float64 `json:"loss_rate"`
|
ArrivalRate float64 `json:"arrival_rate"`
|
||||||
Duplicates int64 `json:"duplicates"`
|
LossRate float64 `json:"loss_rate"`
|
||||||
OutOfOrder int64 `json:"out_of_order"`
|
Duplicates int64 `json:"duplicates"`
|
||||||
Disconnects int64 `json:"disconnects"`
|
OutOfOrder int64 `json:"out_of_order"`
|
||||||
HistoryChecked int64 `json:"history_checked"`
|
Disconnects int64 `json:"disconnects"`
|
||||||
HistoryFound int64 `json:"history_found"`
|
HistoryChecked int64 `json:"history_checked"`
|
||||||
PersistenceLost int64 `json:"persistence_lost"`
|
HistoryFound int64 `json:"history_found"`
|
||||||
Missing []MissingDelivery `json:"missing,omitempty"`
|
PersistenceLost int64 `json:"persistence_lost"`
|
||||||
Passed bool `json:"passed"`
|
Missing []MissingDelivery `json:"missing,omitempty"`
|
||||||
FailureReasons []string `json:"failure_reasons,omitempty"`
|
Passed bool `json:"passed"`
|
||||||
|
FailureReasons []string `json:"failure_reasons,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func runMerge(aPath, bPath, output string) error {
|
func runMerge(aPath, bPath, output string) error {
|
||||||
@@ -54,6 +55,11 @@ func runMerge(aPath, bPath, output string) error {
|
|||||||
report := CombinedReport{RunID: a.RunID, Scenario: a.Scenario, GeneratedAt: time.Now().UTC(), Agents: []AgentSummary{a, b}, Passed: true,
|
report := CombinedReport{RunID: a.RunID, Scenario: a.Scenario, GeneratedAt: time.Now().UTC(), Agents: []AgentSummary{a, b}, Passed: true,
|
||||||
PublishErrors: make(map[string]int64)}
|
PublishErrors: make(map[string]int64)}
|
||||||
for _, summary := range report.Agents {
|
for _, summary := range report.Agents {
|
||||||
|
expectedConnections := summary.ExpectedConnections
|
||||||
|
if expectedConnections == 0 {
|
||||||
|
expectedConnections = 1000
|
||||||
|
}
|
||||||
|
report.ExpectedConnections += expectedConnections
|
||||||
report.ReadyConnections += summary.ReadyConnections
|
report.ReadyConnections += summary.ReadyConnections
|
||||||
report.PublishAttempted += summary.PublishAttempted
|
report.PublishAttempted += summary.PublishAttempted
|
||||||
report.PublishAccepted += summary.PublishAccepted
|
report.PublishAccepted += summary.PublishAccepted
|
||||||
@@ -85,8 +91,9 @@ func runMerge(aPath, bPath, output string) error {
|
|||||||
report.ArrivalRate = float64(report.ReceivedDeliveries) / float64(report.ExpectedDeliveries)
|
report.ArrivalRate = float64(report.ReceivedDeliveries) / float64(report.ExpectedDeliveries)
|
||||||
report.LossRate = float64(report.RealtimeLost) / float64(report.ExpectedDeliveries)
|
report.LossRate = float64(report.RealtimeLost) / float64(report.ExpectedDeliveries)
|
||||||
}
|
}
|
||||||
if report.ReadyConnections != 2000 {
|
if report.ReadyConnections != report.ExpectedConnections {
|
||||||
report.FailureReasons = append(report.FailureReasons, fmt.Sprintf("ready connections=%d expected=2000", report.ReadyConnections))
|
report.FailureReasons = append(report.FailureReasons, fmt.Sprintf("ready connections=%d expected=%d",
|
||||||
|
report.ReadyConnections, report.ExpectedConnections))
|
||||||
}
|
}
|
||||||
if report.PublishAttempted > 0 && report.PublishSuccessRate < 0.9999 {
|
if report.PublishAttempted > 0 && report.PublishSuccessRate < 0.9999 {
|
||||||
report.FailureReasons = append(report.FailureReasons,
|
report.FailureReasons = append(report.FailureReasons,
|
||||||
|
|||||||
@@ -10,10 +10,12 @@ import (
|
|||||||
func TestRunMergeComputesArrivalAndPersistenceGate(t *testing.T) {
|
func TestRunMergeComputesArrivalAndPersistenceGate(t *testing.T) {
|
||||||
dir := t.TempDir()
|
dir := t.TempDir()
|
||||||
a := AgentSummary{RunID: "run1", Scenario: "p2p", Machine: "a", ReadyConnections: 1000,
|
a := AgentSummary{RunID: "run1", Scenario: "p2p", Machine: "a", ReadyConnections: 1000,
|
||||||
PublishAttempted: 10, PublishAccepted: 10, ExpectedPeer: 10, ReceivedPeer: 9,
|
ExpectedConnections: 1000,
|
||||||
|
PublishAttempted: 10, PublishAccepted: 10, ExpectedPeer: 10, ReceivedPeer: 9,
|
||||||
RealtimeLost: 1, HistoryChecked: 10, HistoryFound: 10}
|
RealtimeLost: 1, HistoryChecked: 10, HistoryFound: 10}
|
||||||
b := AgentSummary{RunID: "run1", Scenario: "p2p", Machine: "b", ReadyConnections: 1000,
|
b := AgentSummary{RunID: "run1", Scenario: "p2p", Machine: "b", ReadyConnections: 1000,
|
||||||
PublishAttempted: 10, PublishAccepted: 10, ExpectedPeer: 10, ReceivedPeer: 10,
|
ExpectedConnections: 1000,
|
||||||
|
PublishAttempted: 10, PublishAccepted: 10, ExpectedPeer: 10, ReceivedPeer: 10,
|
||||||
HistoryChecked: 10, HistoryFound: 9, PersistenceLost: 1}
|
HistoryChecked: 10, HistoryFound: 9, PersistenceLost: 1}
|
||||||
aPath, bPath, reportPath := filepath.Join(dir, "a.json"), filepath.Join(dir, "b.json"), filepath.Join(dir, "report.json")
|
aPath, bPath, reportPath := filepath.Join(dir, "a.json"), filepath.Join(dir, "b.json"), filepath.Join(dir, "report.json")
|
||||||
writeSummaryForTest(t, aPath, a)
|
writeSummaryForTest(t, aPath, a)
|
||||||
|
|||||||
@@ -343,38 +343,39 @@ type AcceptedMessage struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type AgentSummary struct {
|
type AgentSummary struct {
|
||||||
RunID string `json:"run_id"`
|
RunID string `json:"run_id"`
|
||||||
Scenario string `json:"scenario"`
|
Scenario string `json:"scenario"`
|
||||||
Machine string `json:"machine"`
|
Machine string `json:"machine"`
|
||||||
StartedAt time.Time `json:"started_at"`
|
StartedAt time.Time `json:"started_at"`
|
||||||
LoadEndedAt time.Time `json:"load_ended_at"`
|
LoadEndedAt time.Time `json:"load_ended_at"`
|
||||||
FinishedAt time.Time `json:"finished_at"`
|
FinishedAt time.Time `json:"finished_at"`
|
||||||
ReadyConnections int `json:"ready_connections"`
|
ExpectedConnections int `json:"expected_connections"`
|
||||||
PublishAttempted int64 `json:"publish_attempted"`
|
ReadyConnections int `json:"ready_connections"`
|
||||||
PublishAccepted int64 `json:"publish_accepted"`
|
PublishAttempted int64 `json:"publish_attempted"`
|
||||||
PublishRejected int64 `json:"publish_rejected"`
|
PublishAccepted int64 `json:"publish_accepted"`
|
||||||
PublishErrors map[string]int64 `json:"publish_errors,omitempty"`
|
PublishRejected int64 `json:"publish_rejected"`
|
||||||
ExpectedPeer int64 `json:"expected_peer"`
|
PublishErrors map[string]int64 `json:"publish_errors,omitempty"`
|
||||||
ReceivedPeer int64 `json:"received_peer"`
|
ExpectedPeer int64 `json:"expected_peer"`
|
||||||
ExpectedEcho int64 `json:"expected_echo"`
|
ReceivedPeer int64 `json:"received_peer"`
|
||||||
ReceivedEcho int64 `json:"received_echo"`
|
ExpectedEcho int64 `json:"expected_echo"`
|
||||||
ExpectedGroup int64 `json:"expected_group"`
|
ReceivedEcho int64 `json:"received_echo"`
|
||||||
ReceivedGroup int64 `json:"received_group"`
|
ExpectedGroup int64 `json:"expected_group"`
|
||||||
RealtimeLost int64 `json:"realtime_lost"`
|
ReceivedGroup int64 `json:"received_group"`
|
||||||
RealtimeLostStored int64 `json:"realtime_lost_but_persisted"`
|
RealtimeLost int64 `json:"realtime_lost"`
|
||||||
Duplicates int64 `json:"duplicates"`
|
RealtimeLostStored int64 `json:"realtime_lost_but_persisted"`
|
||||||
OutOfOrder int64 `json:"out_of_order"`
|
Duplicates int64 `json:"duplicates"`
|
||||||
Disconnects int64 `json:"disconnects"`
|
OutOfOrder int64 `json:"out_of_order"`
|
||||||
UnexpectedMessages int64 `json:"unexpected_messages"`
|
Disconnects int64 `json:"disconnects"`
|
||||||
HistoryChecked int64 `json:"history_checked"`
|
UnexpectedMessages int64 `json:"unexpected_messages"`
|
||||||
HistoryFound int64 `json:"history_found"`
|
HistoryChecked int64 `json:"history_checked"`
|
||||||
PersistenceLost int64 `json:"persistence_lost"`
|
HistoryFound int64 `json:"history_found"`
|
||||||
AckLatency HistogramSnapshot `json:"ack_latency"`
|
PersistenceLost int64 `json:"persistence_lost"`
|
||||||
DeliveryLatency HistogramSnapshot `json:"delivery_latency"`
|
AckLatency HistogramSnapshot `json:"ack_latency"`
|
||||||
Errors []string `json:"errors,omitempty"`
|
DeliveryLatency HistogramSnapshot `json:"delivery_latency"`
|
||||||
Missing []MissingDelivery `json:"missing,omitempty"`
|
Errors []string `json:"errors,omitempty"`
|
||||||
PersistenceMissing []string `json:"persistence_missing,omitempty"`
|
Missing []MissingDelivery `json:"missing,omitempty"`
|
||||||
AcceptedLocal []AcceptedMessage `json:"accepted_local,omitempty"`
|
PersistenceMissing []string `json:"persistence_missing,omitempty"`
|
||||||
|
AcceptedLocal []AcceptedMessage `json:"accepted_local,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MissingDelivery struct {
|
type MissingDelivery struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user