diff --git a/go.mod b/go.mod index 445cc6a6..ea03cdf5 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.15 replace github.com/TeaOSLab/EdgeCommon => ../EdgeCommon - require ( github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/TeaOSLab/EdgeCommon v0.0.0-00010101000000-000000000000 @@ -16,7 +15,7 @@ require ( github.com/go-sql-driver/mysql v1.5.0 github.com/go-yaml/yaml v2.1.0+incompatible github.com/golang/protobuf v1.5.2 - github.com/iwind/TeaGo v0.0.0-20210824034952-1a56ad7d0b5e + github.com/iwind/TeaGo v0.0.0-20210829020150-9c36d31301a5 github.com/iwind/gosock v0.0.0-20210722083328-12b2d66abec3 github.com/json-iterator/go v1.1.11 // indirect github.com/lionsoul2014/ip2region v2.2.0-release+incompatible diff --git a/go.sum b/go.sum index 480af9f0..2114cc61 100644 --- a/go.sum +++ b/go.sum @@ -188,6 +188,8 @@ github.com/iwind/TeaGo v0.0.0-20210809112119-a57ed0e84e34 h1:ZCNQXLiGF5Z1cV3Pi03 github.com/iwind/TeaGo v0.0.0-20210809112119-a57ed0e84e34/go.mod h1:KU4mS7QNiZ7QWEuDBk1zw0/Q2LrAPZv3tycEFBsuUwc= github.com/iwind/TeaGo v0.0.0-20210824034952-1a56ad7d0b5e h1:GDCU57lQD6W9u5KT2834MmK022FSeAbskb7H0p2eaJY= github.com/iwind/TeaGo v0.0.0-20210824034952-1a56ad7d0b5e/go.mod h1:KU4mS7QNiZ7QWEuDBk1zw0/Q2LrAPZv3tycEFBsuUwc= +github.com/iwind/TeaGo v0.0.0-20210829020150-9c36d31301a5 h1:ybjIXGT3E/ZbfkRhIb903WMfLyt2Uv5p4niAqi8jwvM= +github.com/iwind/TeaGo v0.0.0-20210829020150-9c36d31301a5/go.mod h1:KU4mS7QNiZ7QWEuDBk1zw0/Q2LrAPZv3tycEFBsuUwc= github.com/iwind/gosock v0.0.0-20210722083328-12b2d66abec3 h1:aBSonas7vFcgTj9u96/bWGILGv1ZbUSTLiOzcI1ZT6c= github.com/iwind/gosock v0.0.0-20210722083328-12b2d66abec3/go.mod h1:H5Q7SXwbx3a97ecJkaS2sD77gspzE7HFUafBO0peEyA= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= diff --git a/internal/db/models/server_dao_test.go b/internal/db/models/server_dao_test.go index 3a8c3d7a..232847b4 100644 --- a/internal/db/models/server_dao_test.go +++ b/internal/db/models/server_dao_test.go @@ -144,3 +144,15 @@ func TestServerDAO_FindAllEnabledServersWithNode(t *testing.T) { t.Log("serverId:", server.Id, "clusterId:", server.ClusterId) } } + +func BenchmarkServerDAO_CountAllEnabledServers(b *testing.B) { + SharedServerDAO = NewServerDAO() + + for i := 0; i < b.N; i++ { + result, err := SharedServerDAO.CountAllEnabledServers(nil) + if err != nil { + b.Fatal(err) + } + _ = result + } +}