服务带宽API增加按月、按日查询接口

This commit is contained in:
刘祥超
2022-08-01 15:40:57 +08:00
parent c325fde52b
commit c309da81ae
3 changed files with 89 additions and 0 deletions

View File

@@ -43,6 +43,30 @@ func TestServerBandwidthStatDAO_FindMonthlyPercentile(t *testing.T) {
t.Log(dao.FindMonthlyPercentile(tx, 23, timeutil.Format("Ym"), 95))
}
func TestServerBandwidthStatDAO_FindAllServerStatsWithMonth(t *testing.T) {
var dao = models.NewServerBandwidthStatDAO()
var tx *dbs.Tx
stats, err := dao.FindAllServerStatsWithMonth(tx, 23, timeutil.Format("Ym"))
if err != nil {
t.Fatal(err)
}
for _, stat := range stats {
t.Logf("%+v", stat)
}
}
func TestServerBandwidthStatDAO_FindAllServerStatsWithDay(t *testing.T) {
var dao = models.NewServerBandwidthStatDAO()
var tx *dbs.Tx
stats, err := dao.FindAllServerStatsWithDay(tx, 23, timeutil.Format("Ymd"))
if err != nil {
t.Fatal(err)
}
for _, stat := range stats {
t.Logf("%+v", stat)
}
}
func TestServerBandwidthStatDAO_Clean(t *testing.T) {
var dao = models.NewServerBandwidthStatDAO()
var tx *dbs.Tx