gatus/storage/store/memory/util_bench_test.go
TwiN 6ed93d4b82
Rename Service to Endpoint (#192)
* Add clarifications in comments

* #191: Rename Service to Endpoint
2021-10-23 16:47:12 -04:00

22 lines
566 B
Go

package memory
import (
"testing"
"github.com/TwiN/gatus/v3/core"
"github.com/TwiN/gatus/v3/storage/store/common"
"github.com/TwiN/gatus/v3/storage/store/common/paging"
)
func BenchmarkShallowCopyEndpointStatus(b *testing.B) {
endpoint := &testEndpoint
status := core.NewEndpointStatus(endpoint.Group, endpoint.Name)
for i := 0; i < common.MaximumNumberOfResults; i++ {
AddResult(status, &testSuccessfulResult)
}
for n := 0; n < b.N; n++ {
ShallowCopyEndpointStatus(status, paging.NewEndpointStatusParams().WithResults(1, 20))
}
b.ReportAllocs()
}