mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Fix ProxyEventLogger output
This commit is contained in:
parent
1116bc81c8
commit
88af9da4a2
1 changed files with 2 additions and 2 deletions
|
@ -9,7 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewProxyEventLogger(logPeriod time.Duration) event.SnowflakeEventReceiver {
|
func NewProxyEventLogger(logPeriod time.Duration) event.SnowflakeEventReceiver {
|
||||||
el := &logEventLogger{}
|
el := &logEventLogger{logPeriod: logPeriod}
|
||||||
el.task = &task.Periodic{Interval: logPeriod, Execute: el.logTick}
|
el.task = &task.Periodic{Interval: logPeriod, Execute: el.logTick}
|
||||||
el.task.Start()
|
el.task.Start()
|
||||||
return el
|
return el
|
||||||
|
@ -36,7 +36,7 @@ func (p *logEventLogger) OnNewSnowflakeEvent(e event.SnowflakeEvent) {
|
||||||
func (p *logEventLogger) logTick() error {
|
func (p *logEventLogger) logTick() error {
|
||||||
inbound, inboundUnit := formatTraffic(p.inboundSum)
|
inbound, inboundUnit := formatTraffic(p.inboundSum)
|
||||||
outbound, outboundUnit := formatTraffic(p.inboundSum)
|
outbound, outboundUnit := formatTraffic(p.inboundSum)
|
||||||
fmt.Printf("In the last %v, there are %v connections. Traffic Relaied ↑ %v %v, ↓ %v %v.",
|
fmt.Printf("In the last %v, there are %v connections. Traffic Relaied ↑ %v %v, ↓ %v %v.\n",
|
||||||
p.logPeriod.String(), p.connectionCount, inbound, inboundUnit, outbound, outboundUnit)
|
p.logPeriod.String(), p.connectionCount, inbound, inboundUnit, outbound, outboundUnit)
|
||||||
p.outboundSum = 0
|
p.outboundSum = 0
|
||||||
p.inboundSum = 0
|
p.inboundSum = 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue