mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-30 09:56:35 +08:00
优化统计相关程序
This commit is contained in:
@@ -4,32 +4,8 @@ import (
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"github.com/iwind/TeaGo/dbs"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestRegionProvinceDAO_FindProvinceIdWithNameCacheable(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")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRegionProvinceDAO_FindProvinceIdWithName(t *testing.T) {
|
||||
dbs.NotifyReady()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user