记录节点/集群的流量统计以备将来使用

This commit is contained in:
刘祥超
2021-01-21 20:22:58 +08:00
parent 22667b7d0a
commit 1d4f01a062
20 changed files with 189 additions and 17 deletions

View File

@@ -0,0 +1,20 @@
package stats
import (
_ "github.com/go-sql-driver/mysql"
"github.com/iwind/TeaGo/dbs"
timeutil "github.com/iwind/TeaGo/utils/time"
"testing"
"time"
)
func TestTrafficHourlyStatDAO_IncreaseDayBytes(t *testing.T) {
dbs.NotifyReady()
now := time.Now()
err := SharedTrafficHourlyStatDAO.IncreaseHourlyBytes(nil, timeutil.Format("YmdH"), 1)
if err != nil {
t.Fatal(err)
}
t.Log("ok", time.Since(now).Seconds()*1000, "ms")
}