mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-07 10:40:25 +08:00
实现总体流量按天统计、按小时统计,提供管理平台Dashboard API
This commit is contained in:
30
internal/utils/time_test.go
Normal file
30
internal/utils/time_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package utils
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestRangeDays(t *testing.T) {
|
||||
days, err := RangeDays("20210101", "20210115")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(days)
|
||||
}
|
||||
|
||||
|
||||
func TestRangeHours(t *testing.T) {
|
||||
{
|
||||
hours, err := RangeHours("2021010100", "2021010123")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(hours)
|
||||
}
|
||||
|
||||
{
|
||||
hours, err := RangeHours("2021010105", "2021010112")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(hours)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user