实现总体流量按天统计、按小时统计,提供管理平台Dashboard API

This commit is contained in:
GoEdgeLab
2021-01-21 18:55:34 +08:00
parent f914f45098
commit f947d769f7
15 changed files with 489 additions and 4 deletions

View File

@@ -0,0 +1,20 @@
package models
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.IncreaseDayBytes(nil, timeutil.Format("YmdH"), 1)
if err != nil {
t.Fatal(err)
}
t.Log("ok", time.Since(now).Seconds()*1000, "ms")
}