diff options
author | Cecylia Bocovich <cohosh@torproject.org> | 2023-10-31 10:02:31 -0400 |
---|---|---|
committer | Cecylia Bocovich <cohosh@torproject.org> | 2023-10-31 10:02:31 -0400 |
commit | caa2b3646329b9342d3346a9814e653285c0a8d0 (patch) | |
tree | 492c01706c4b3981d818f8ef040388a2a83f1701 | |
parent | 5c5eb2c339f15283094576cba0f8b1083b451c82 (diff) | |
download | snowflake-caa2b3646329b9342d3346a9814e653285c0a8d0.tar.gz snowflake-caa2b3646329b9342d3346a9814e653285c0a8d0.zip |
Process and properly log connection closure stats
-rw-r--r-- | common/event/interface.go | 2 | ||||
-rw-r--r-- | proxy/lib/snowflake.go | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/common/event/interface.go b/common/event/interface.go index c01b462..eb73dfa 100644 --- a/common/event/interface.go +++ b/common/event/interface.go @@ -74,7 +74,7 @@ type EventOnProxyConnectionOver struct { } func (e EventOnProxyConnectionOver) String() string { - return fmt.Sprintf("Proxy connection closed (↑ %d, ↓ %d)", e.InboundTraffic, e.OutboundTraffic) + return fmt.Sprintf("Proxy connection closed") } type EventOnProxyStats struct { diff --git a/proxy/lib/snowflake.go b/proxy/lib/snowflake.go index a0c0ce0..0c85754 100644 --- a/proxy/lib/snowflake.go +++ b/proxy/lib/snowflake.go @@ -661,6 +661,7 @@ func (sf *SnowflakeProxy) Start() error { if !sf.DisableStatsLogger { sf.bytesLogger = newBytesSyncLogger() sf.periodicProxyStats = newPeriodicProxyStats(sf.SummaryInterval, sf.EventDispatcher, sf.bytesLogger) + sf.EventDispatcher.AddSnowflakeEventListener(sf.periodicProxyStats) } broker, err = newSignalingServer(sf.BrokerURL, sf.KeepLocalAddresses) |