Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Lavor <[email protected]>
  • Loading branch information
VladoLavor committed Jan 23, 2024
1 parent a5374b4 commit 6e6d428
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/memory/memory_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ const (
)

// TestAPIMemory tests the GoVPP memory consumption for various numbers of API calls
func TestAPIMemory(t *testing.T) {
func BenchmarkAPIMemory(b *testing.B) {
flag.Parse()

fmt.Printf("Running GoVPP API calls memory test\n\n")
test := vpptesting.SetupVPP(t)
test := vpptesting.SetupVPP(b)
vpeRPC := vpe.NewServiceClient(test.Conn)

samples := []metrics.Sample{
Expand All @@ -66,7 +66,7 @@ func TestAPIMemory(t *testing.T) {
metricsBefore := readMetrics(samples)
for i := 0; i < int(n); i++ {
if _, err := vpeRPC.ShowVersion(context.Background(), &vpe.ShowVersion{}); err != nil {
t.Fatal("calling show version failed:", err)
b.Fatal("calling show version failed:", err)
}
}
metricsAfter := readMetrics(samples)
Expand Down Expand Up @@ -110,11 +110,11 @@ func TestAPIMemory(t *testing.T) {
testAPICalls(1000, [3]uint64{2621440, 3145728, 50000})
testAPICalls(10000, [3]uint64{26214400, 3145728, 50000})
testAPICalls(100000, [3]uint64{262144000, 5242880, 50000})
testAPICalls(1000000, [3]uint64{2684364560, 5242880, 50000})
//testAPICalls(1000000, [3]uint64{2684364560, 5242880, 50000})
//testAPICalls(10000000, [3]uint64{26843645600, 5242880, 50000})

if !pass {
t.Fatal("one or more memory thresholds was exceeded")
b.Fatal("one or more memory thresholds was exceeded")
}
}

Expand Down

0 comments on commit 6e6d428

Please sign in to comment.