diff options
author | WofWca <wofwca@protonmail.com> | 2023-01-12 08:54:59 +0000 |
---|---|---|
committer | itchyonion <itchyonion@torproject.org> | 2023-02-09 11:45:09 -0800 |
commit | 5cc849e186a7b5f5cac238e3497a64bd46ac0a29 (patch) | |
tree | eb9386b444f7d41739e59ee316b02b519c49b0ed | |
parent | 990fcb41274f8d983c23b035636a22e4491290d8 (diff) | |
download | snowflake-5cc849e186a7b5f5cac238e3497a64bd46ac0a29.tar.gz snowflake-5cc849e186a7b5f5cac238e3497a64bd46ac0a29.zip |
fix: up/down traffic stats being mixed up
-rw-r--r-- | proxy/lib/pt_event_logger.go | 2 | ||||
-rw-r--r-- | proxy/lib/util.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/proxy/lib/pt_event_logger.go b/proxy/lib/pt_event_logger.go index ce89545..745437b 100644 --- a/proxy/lib/pt_event_logger.go +++ b/proxy/lib/pt_event_logger.go @@ -41,7 +41,7 @@ func (p *logEventLogger) OnNewSnowflakeEvent(e event.SnowflakeEvent) { func (p *logEventLogger) logTick() error { inbound, inboundUnit := formatTraffic(p.inboundSum) outbound, outboundUnit := formatTraffic(p.outboundSum) - p.logger.Printf("In the last %v, there were %v connections. Traffic Relayed ↑ %v %v, ↓ %v %v.\n", + p.logger.Printf("In the last %v, there were %v connections. Traffic Relayed ↓ %v %v, ↑ %v %v.\n", p.logPeriod.String(), p.connectionCount, inbound, inboundUnit, outbound, outboundUnit) p.outboundSum = 0 p.inboundSum = 0 diff --git a/proxy/lib/util.go b/proxy/lib/util.go index 0bbe588..dd8681e 100644 --- a/proxy/lib/util.go +++ b/proxy/lib/util.go @@ -80,7 +80,7 @@ func (b *bytesSyncLogger) ThroughputSummary() string { outbound, outUnit := formatTraffic(outbound) t := time.Now() - return fmt.Sprintf("Traffic throughput (up|down): %d %s|%d %s -- (%d OnMessages, %d Sends, over %d seconds)", inbound, inUnit, outbound, outUnit, b.outEvents, b.inEvents, int(t.Sub(b.start).Seconds())) + return fmt.Sprintf("Traffic throughput (down|up): %d %s|%d %s -- (%d OnMessages, %d Sends, over %d seconds)", inbound, inUnit, outbound, outUnit, b.outEvents, b.inEvents, int(t.Sub(b.start).Seconds())) } func (b *bytesSyncLogger) GetStat() (in int64, out int64) { return b.inbound, b.outbound } |