优化统计相关程序

This commit is contained in:
GoEdgeLab
2023-03-12 10:20:56 +08:00
parent 9388ffce6c
commit d5a807b51f
11 changed files with 43 additions and 287 deletions

View File

@@ -3,31 +3,4 @@ package regions
import (
_ "github.com/go-sql-driver/mysql"
_ "github.com/iwind/TeaGo/bootstrap"
"github.com/iwind/TeaGo/dbs"
"testing"
"time"
)
func TestRegionProviderDAO_FindProviderIdWithProviderNameCacheable(t *testing.T) {
dbs.NotifyReady()
for i := 0; i < 5; i++ {
now := time.Now()
providerId, err := SharedRegionProviderDAO.FindProviderIdWithNameCacheable(nil, "电信")
if err != nil {
t.Fatal(err)
}
t.Log("providerId", providerId, time.Since(now).Seconds()*1000, "ms")
}
t.Log("=====")
for i := 0; i < 5; i++ {
now := time.Now()
providerId, err := SharedRegionProviderDAO.FindProviderIdWithNameCacheable(nil, "胡乱填的")
if err != nil {
t.Fatal(err)
}
t.Log("providerId", providerId, time.Since(now).Seconds()*1000, "ms")
}
}