Implement paging and refactor stores to match new store interface with paging

This commit is contained in:
TwinProduction authored and Chris committed 2021-07-18 17:29:08 -04:00
1 parent 677c7faffe
commit 7126d36d85
19 files changed
+421 -404

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
package memory
import (
"testing"
"github.com/TwinProduction/gatus/core"
"github.com/TwinProduction/gatus/storage/store/paging"
)
func BenchmarkShallowCopyServiceStatus(b *testing.B) {
service := &testService
serviceStatus := core.NewServiceStatus(service.Key(), service.Group, service.Name)
for i := 0; i < core.MaximumNumberOfResults; i++ {
AddResult(serviceStatus, &testSuccessfulResult)
}
for n := 0; n < b.N; n++ {
ShallowCopyServiceStatus(serviceStatus, paging.NewServiceStatusParams().WithResults(1, 20))
}
b.ReportAllocs()
}