diff options
author | Shelikhoo <xiaokangwang@outlook.com> | 2021-12-20 16:22:55 +0000 |
---|---|---|
committer | Shelikhoo <xiaokangwang@outlook.com> | 2022-01-25 13:03:19 +0000 |
commit | 88af9da4a25c26169cadaee9256ce7539db17b19 (patch) | |
tree | c1a03b8727930d7d1e69887e4f9abe5313253833 | |
parent | 1116bc81c86580316e13b07ecd8d7f0a3ac5ffd5 (diff) | |
download | snowflake-88af9da4a25c26169cadaee9256ce7539db17b19.tar.gz snowflake-88af9da4a25c26169cadaee9256ce7539db17b19.zip |
Fix ProxyEventLogger output
-rw-r--r-- | proxy/lib/pt_event_logger.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/proxy/lib/pt_event_logger.go b/proxy/lib/pt_event_logger.go index 5804614..6c4f4e9 100644 --- a/proxy/lib/pt_event_logger.go +++ b/proxy/lib/pt_event_logger.go @@ -9,7 +9,7 @@ import ( ) func NewProxyEventLogger(logPeriod time.Duration) event.SnowflakeEventReceiver { - el := &logEventLogger{} + el := &logEventLogger{logPeriod: logPeriod} el.task = &task.Periodic{Interval: logPeriod, Execute: el.logTick} el.task.Start() return el @@ -36,7 +36,7 @@ func (p *logEventLogger) OnNewSnowflakeEvent(e event.SnowflakeEvent) { func (p *logEventLogger) logTick() error { inbound, inboundUnit := 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.outboundSum = 0 p.inboundSum = 0 |