mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
Log average transfer rate
Adds the average transfer rate for the summary interval to the summary log lines
This commit is contained in:
parent
f4305180b9
commit
93f5d1ef7f
1 changed files with 4 additions and 2 deletions
|
@ -86,8 +86,10 @@ type EventOnProxyStats struct {
|
|||
}
|
||||
|
||||
func (e EventOnProxyStats) String() string {
|
||||
statString := fmt.Sprintf("In the last %v, there were %v completed connections. Traffic Relayed ↓ %v %v, ↑ %v %v.",
|
||||
e.SummaryInterval.String(), e.ConnectionCount, e.InboundBytes, e.InboundUnit, e.OutboundBytes, e.OutboundUnit)
|
||||
statString := fmt.Sprintf("In the last %v, there were %v completed connections. Traffic Relayed ↓ %v %v (%.2f %v%s), ↑ %v %v (%.2f %v%s).",
|
||||
e.SummaryInterval.String(), e.ConnectionCount,
|
||||
e.InboundBytes, e.InboundUnit, float64(e.InboundBytes)/e.SummaryInterval.Seconds(), e.InboundUnit, "/s",
|
||||
e.OutboundBytes, e.OutboundUnit, float64(e.OutboundBytes)/e.SummaryInterval.Seconds(), e.OutboundUnit, "/s")
|
||||
return statString
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue