请求统计增加即时、按天

This commit is contained in:
GoEdgeLab
2021-06-08 15:10:08 +08:00
parent 2a4417590b
commit 2a3a8a1e98
3 changed files with 166 additions and 8 deletions

View File

@@ -57,9 +57,20 @@ func TestServerDailyStatDAO_SumHourlyRequests(t *testing.T) {
dbs.NotifyReady()
var tx *dbs.Tx
stats, err := NewServerDailyStatDAO().SumHourlyStats(tx, 23, timeutil.Format("YmdH"))
stat, err := NewServerDailyStatDAO().SumHourlyStat(tx, 23, timeutil.Format("YmdH"))
if err != nil {
t.Fatal(err)
}
logs.PrintAsJSON(stats, t)
logs.PrintAsJSON(stat, t)
}
func TestServerDailyStatDAO_SumMinutelyRequests(t *testing.T) {
dbs.NotifyReady()
var tx *dbs.Tx
stat, err := NewServerDailyStatDAO().SumMinutelyStat(tx, 23, timeutil.Format("Ymd") + "1435")
if err != nil {
t.Fatal(err)
}
logs.PrintAsJSON(stat, t)
}