Process and properly log connection closure stats

This commit is contained in:
Cecylia Bocovich 2023-10-31 10:02:31 -04:00
parent 5c5eb2c339
commit caa2b36463
No known key found for this signature in database
GPG key ID: 009DE379FD9B7B90
2 changed files with 2 additions and 1 deletions

View file

@ -74,7 +74,7 @@ type EventOnProxyConnectionOver struct {
} }
func (e EventOnProxyConnectionOver) String() string { 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 { type EventOnProxyStats struct {

View file

@ -661,6 +661,7 @@ func (sf *SnowflakeProxy) Start() error {
if !sf.DisableStatsLogger { if !sf.DisableStatsLogger {
sf.bytesLogger = newBytesSyncLogger() sf.bytesLogger = newBytesSyncLogger()
sf.periodicProxyStats = newPeriodicProxyStats(sf.SummaryInterval, sf.EventDispatcher, sf.bytesLogger) sf.periodicProxyStats = newPeriodicProxyStats(sf.SummaryInterval, sf.EventDispatcher, sf.bytesLogger)
sf.EventDispatcher.AddSnowflakeEventListener(sf.periodicProxyStats)
} }
broker, err = newSignalingServer(sf.BrokerURL, sf.KeepLocalAddresses) broker, err = newSignalingServer(sf.BrokerURL, sf.KeepLocalAddresses)