diff options
author | David Fifield <david@bamsoftware.com> | 2023-09-05 05:42:15 +0000 |
---|---|---|
committer | Shelikhoo <xiaokangwang@outlook.com> | 2023-10-09 16:16:05 +0100 |
commit | 6393af6bab0f7c3c95b11352d5c582d2000062fa (patch) | |
tree | adee64e54777dcde3d09903552dc74ffcfdb577e /broker | |
parent | a615e8b1ab88ac91a1a5588c1d6e41698e7af043 (diff) | |
download | snowflake-6393af6bab0f7c3c95b11352d5c582d2000062fa.tar.gz snowflake-6393af6bab0f7c3c95b11352d5c582d2000062fa.zip |
Remove proxy churn measurements from broker.
We've done the analysis we planned to do on these measurements.
A program to analyze the proxy churn and extract hour-by-hour
intersections is available at:
https://github.com/turfed/snowflake-paper/tree/main/figures/proxy-churn
Closes #40280.
Diffstat (limited to 'broker')
-rw-r--r-- | broker/broker.go | 17 | ||||
-rw-r--r-- | broker/ipc.go | 1 | ||||
-rw-r--r-- | broker/metrics.go | 13 |
3 files changed, 0 insertions, 31 deletions
diff --git a/broker/broker.go b/broker/broker.go index c3541c1..33f45ab 100644 --- a/broker/broker.go +++ b/broker/broker.go @@ -11,8 +11,6 @@ import ( "crypto/tls" "flag" "gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/bridgefingerprint" - "gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/ipsetsink" - "gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/ipsetsink/sinkcluster" "io" "log" "net/http" @@ -196,8 +194,6 @@ func main() { var certFilename, keyFilename string var disableGeoip bool var metricsFilename string - var ipCountFilename, ipCountMaskingKey string - var ipCountInterval time.Duration var unsafeLogging bool flag.StringVar(&acmeEmail, "acme-email", "", "optional contact email for Let's Encrypt notifications") @@ -214,9 +210,6 @@ func main() { flag.BoolVar(&disableTLS, "disable-tls", false, "don't use HTTPS") flag.BoolVar(&disableGeoip, "disable-geoip", false, "don't use geoip for stats collection") flag.StringVar(&metricsFilename, "metrics-log", "", "path to metrics logging output") - flag.StringVar(&ipCountFilename, "ip-count-log", "", "path to ip count logging output") - flag.StringVar(&ipCountMaskingKey, "ip-count-mask", "", "masking key for ip count logging") - flag.DurationVar(&ipCountInterval, "ip-count-interval", time.Hour, "time interval between each chunk") flag.BoolVar(&unsafeLogging, "unsafe-logging", false, "prevent logs from being scrubbed") flag.Parse() @@ -264,16 +257,6 @@ func main() { } } - if ipCountFilename != "" { - ipCountFile, err := os.OpenFile(ipCountFilename, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) - - if err != nil { - log.Fatal(err.Error()) - } - ipSetSink := ipsetsink.NewIPSetSink(ipCountMaskingKey) - ctx.metrics.distinctIPWriter = sinkcluster.NewClusterWriter(ipCountFile, ipCountInterval, ipSetSink) - } - go ctx.Broker() i := &IPC{ctx} diff --git a/broker/ipc.go b/broker/ipc.go index b77c579..7cbdd06 100644 --- a/broker/ipc.go +++ b/broker/ipc.go @@ -107,7 +107,6 @@ func (i *IPC) ProxyPolls(arg messages.Arg, response *[]byte) error { } else { i.ctx.metrics.lock.Lock() i.ctx.metrics.UpdateCountryStats(remoteIP, proxyType, natType) - i.ctx.metrics.RecordIPAddress(remoteIP) i.ctx.metrics.lock.Unlock() } diff --git a/broker/metrics.go b/broker/metrics.go index b3f9d40..8788a96 100644 --- a/broker/metrics.go +++ b/broker/metrics.go @@ -16,7 +16,6 @@ import ( "github.com/prometheus/client_golang/prometheus" "gitlab.torproject.org/tpo/anti-censorship/geoip" - "gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/ipsetsink/sinkcluster" "gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/messages" ) @@ -42,8 +41,6 @@ type Metrics struct { logger *log.Logger geoipdb *geoip.Geoip - distinctIPWriter *sinkcluster.ClusterWriter - countryStats CountryStats clientRoundtripEstimate time.Duration proxyIdleCount uint @@ -327,13 +324,3 @@ func initPrometheus() *PromMetrics { return promMetrics } - -func (m *Metrics) RecordIPAddress(ip string) { - if m.distinctIPWriter != nil { - m.distinctIPWriter.AddIPToSet(ip) - } -} - -func (m *Metrics) SetIPAddressRecorder(recorder *sinkcluster.ClusterWriter) { - m.distinctIPWriter = recorder -} |