mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-30 12:20:25 +08:00
限制单个服务每次上传的域名统计数不超过20个
This commit is contained in:
@@ -10,22 +10,22 @@ import (
|
||||
|
||||
func TestBandwidthStatManager_Add(t *testing.T) {
|
||||
var manager = stats.NewBandwidthStatManager()
|
||||
manager.Add(1, 1, 10, 10)
|
||||
manager.Add(1, 1, 10, 10)
|
||||
manager.Add(1, 1, 10, 10)
|
||||
manager.AddBandwidth(1, 1, 10, 10)
|
||||
manager.AddBandwidth(1, 1, 10, 10)
|
||||
manager.AddBandwidth(1, 1, 10, 10)
|
||||
time.Sleep(1 * time.Second)
|
||||
manager.Add(1, 1, 85, 85)
|
||||
manager.AddBandwidth(1, 1, 85, 85)
|
||||
time.Sleep(1 * time.Second)
|
||||
manager.Add(1, 1, 25, 25)
|
||||
manager.Add(1, 1, 75, 75)
|
||||
manager.AddBandwidth(1, 1, 25, 25)
|
||||
manager.AddBandwidth(1, 1, 75, 75)
|
||||
manager.Inspect()
|
||||
}
|
||||
|
||||
func TestBandwidthStatManager_Loop(t *testing.T) {
|
||||
var manager = stats.NewBandwidthStatManager()
|
||||
manager.Add(1, 1, 10, 10)
|
||||
manager.Add(1, 1, 10, 10)
|
||||
manager.Add(1, 1, 10, 10)
|
||||
manager.AddBandwidth(1, 1, 10, 10)
|
||||
manager.AddBandwidth(1, 1, 10, 10)
|
||||
manager.AddBandwidth(1, 1, 10, 10)
|
||||
err := manager.Loop()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user