对服务增加基础的数据统计/部分代码分Package

This commit is contained in:
GoEdgeLab
2021-01-25 16:40:03 +08:00
parent f1c325713d
commit 2f9fe99088
106 changed files with 2095 additions and 148 deletions

View File

@@ -0,0 +1,31 @@
package regions
import (
_ "github.com/go-sql-driver/mysql"
"github.com/iwind/TeaGo/dbs"
"testing"
"time"
)
func TestRegionProvinceDAO_FindProvinceIdWithProvinceName(t *testing.T) {
dbs.NotifyReady()
for i := 0; i < 5; i++ {
now := time.Now()
provinceId, err := SharedRegionProvinceDAO.FindProvinceIdWithNameCacheable(nil, 1, "安徽省")
if err != nil {
t.Fatal(err)
}
t.Log(provinceId, time.Since(now).Seconds()*1000, "ms")
}
t.Log("====")
for i := 0; i < 5; i++ {
now := time.Now()
provinceId, err := SharedRegionProvinceDAO.FindProvinceIdWithNameCacheable(nil, 2, "安徽省")
if err != nil {
t.Fatal(err)
}
t.Log(provinceId, time.Since(now).Seconds()*1000, "ms")
}
}