上传统计数据时自动清理旧数据

This commit is contained in:
刘祥超
2021-07-28 17:04:31 +08:00
parent a15ad7dd04
commit 3b2f6060b8
5 changed files with 34 additions and 4 deletions

View File

@@ -3,4 +3,16 @@ package models
import (
_ "github.com/go-sql-driver/mysql"
_ "github.com/iwind/TeaGo/bootstrap"
"github.com/iwind/TeaGo/types"
"testing"
)
func TestNewMetricStatDAO_InsertMany(t *testing.T) {
for i := 0; i <= 1; i++ {
err := NewMetricStatDAO().CreateStat(nil, types.String(i) + "_v1", 18, 48, 23, 25, []string{"/html" + types.String(i)}, 1, "20210728", 0)
if err != nil {
t.Fatal(err)
}
}
t.Log("done")
}