mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-11 02:43:13 +08:00
增加管理后台
This commit is contained in:
@@ -2,32 +2,10 @@ package sessdata
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/bjdgyc/anylink/common"
|
||||
|
||||
"golang.org/x/time/rate"
|
||||
)
|
||||
|
||||
var Sess = &ConnSession{}
|
||||
|
||||
func init() {
|
||||
return
|
||||
tick := time.Tick(time.Second * 2)
|
||||
go func() {
|
||||
for range tick {
|
||||
uP := common.HumanByte(float64(Sess.BandwidthUpPeriod / BandwidthPeriodSec))
|
||||
dP := common.HumanByte(float64(Sess.BandwidthDownPeriod / BandwidthPeriodSec))
|
||||
uA := common.HumanByte(float64(Sess.BandwidthUpAll))
|
||||
dA := common.HumanByte(float64(Sess.BandwidthDownAll))
|
||||
|
||||
fmt.Printf("rateUp:%s rateDown:%s allUp %s allDown %s \n",
|
||||
uP, dP, uA, dA)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
type LimitRater struct {
|
||||
limit *rate.Limiter
|
||||
}
|
||||
|
Reference in New Issue
Block a user