mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Remove ThroughputSummary from bytesLogger
This was leftover from when we used to log the total throughput of connections when they close. It should be removed for privacy reasons as mentioned in https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40079
This commit is contained in:
parent
10fb9afaa7
commit
939062c7dd
2 changed files with 0 additions and 18 deletions
|
@ -1,7 +1,6 @@
|
|||
package snowflake_proxy
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -10,7 +9,6 @@ import (
|
|||
type bytesLogger interface {
|
||||
AddOutbound(int64)
|
||||
AddInbound(int64)
|
||||
ThroughputSummary() string
|
||||
GetStat() (in int64, out int64)
|
||||
}
|
||||
|
||||
|
@ -23,9 +21,6 @@ func (b bytesNullLogger) AddOutbound(amount int64) {}
|
|||
// AddInbound in bytesNullLogger does nothing
|
||||
func (b bytesNullLogger) AddInbound(amount int64) {}
|
||||
|
||||
// ThroughputSummary in bytesNullLogger does nothing
|
||||
func (b bytesNullLogger) ThroughputSummary() string { return "" }
|
||||
|
||||
func (b bytesNullLogger) GetStat() (in int64, out int64) { return -1, -1 }
|
||||
|
||||
// bytesSyncLogger uses channels to safely log from multiple sources with output
|
||||
|
@ -71,18 +66,6 @@ func (b *bytesSyncLogger) AddInbound(amount int64) {
|
|||
b.inboundChan <- amount
|
||||
}
|
||||
|
||||
// ThroughputSummary view a formatted summary of the throughput totals
|
||||
func (b *bytesSyncLogger) ThroughputSummary() string {
|
||||
inbound := b.inbound
|
||||
outbound := b.outbound
|
||||
|
||||
inbound, inUnit := formatTraffic(inbound)
|
||||
outbound, outUnit := formatTraffic(outbound)
|
||||
|
||||
t := time.Now()
|
||||
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 }
|
||||
|
||||
func formatTraffic(amount int64) (value int64, unit string) { return amount / 1000, "KB" }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue