Skip to content
Snippets Groups Projects
Verified Commit 88af9da4 authored by shelikhoo's avatar shelikhoo
Browse files

Fix ProxyEventLogger output

parent 1116bc81
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ import ( ...@@ -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) { ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment