feat(go): add 100k ingest hardening baseline
This commit is contained in:
28
go/vehicle-gateway/cmd/load-sim/main_test.go
Normal file
28
go/vehicle-gateway/cmd/load-sim/main_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"lingniu-vehicle-ingest/go/vehicle-gateway/internal/loadsim"
|
||||
)
|
||||
|
||||
func TestFormatStatsIncludesCapacityCounters(t *testing.T) {
|
||||
out := formatStats(loadsim.Stats{
|
||||
ConnectionsOpened: 10,
|
||||
ConnectionsFailed: 2,
|
||||
FramesWritten: 300,
|
||||
WriteErrors: 1,
|
||||
})
|
||||
|
||||
for _, want := range []string{
|
||||
"connections_opened=10",
|
||||
"connections_failed=2",
|
||||
"frames_written=300",
|
||||
"write_errors=1",
|
||||
} {
|
||||
if !strings.Contains(out, want) {
|
||||
t.Fatalf("formatStats() = %q, missing %q", out, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user