Move creation of periodic stats task inside proxy library

This adds a new type of SnowflakeEvent. EventOnProxyStats is triggered
by the periodic task run at SummaryInterval and produces an event with a
proxy stats output string.
This commit is contained in:
Cecylia Bocovich 2023-10-28 16:04:09 -04:00
parent 83a7422fe6
commit 354cb65432
No known key found for this signature in database
GPG key ID: 009DE379FD9B7B90
4 changed files with 54 additions and 19 deletions

View file

@ -76,6 +76,15 @@ func (e EventOnProxyConnectionOver) String() string {
return fmt.Sprintf("Proxy connection closed (↑ %d, ↓ %d)", e.InboundTraffic, e.OutboundTraffic)
}
type EventOnProxyStats struct {
SnowflakeEvent
StatString string
}
func (e EventOnProxyStats) String() string {
return e.StatString
}
type EventOnCurrentNATTypeDetermined struct {
SnowflakeEvent
CurNATType string