Skip to content

Commit 4e4c498

Browse files
authored
Merge pull request #13 from Jigsaw-Code/fortuna-opt
Remove status from cipher time
2 parents 7e51dbe + 19b8ce0 commit 4e4c498

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

metrics/metrics.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func NewShadowsocksMetrics(ipCountryDB *geoip2.Reader) ShadowsocksMetrics {
105105
Name: "time_to_cipher_ms",
106106
Help: "Time needed to find the cipher",
107107
Objectives: map[float64]float64{0.5: 0.02, 0.9: 0.01, 0.99: 0.005},
108-
}, []string{"proto", "location", "status", "access_key"}),
108+
}, []string{"proto", "location", "access_key"}),
109109
udpAddedNatEntries: prometheus.NewCounter(
110110
prometheus.CounterOpts{
111111
Namespace: "shadowsocks",
@@ -177,15 +177,15 @@ func (m *shadowsocksMetrics) AddOpenTCPConnection(clientLocation string) {
177177
func (m *shadowsocksMetrics) AddClosedTCPConnection(clientLocation, accessKey, status string, data ProxyMetrics, timeToCipher, duration time.Duration) {
178178
m.tcpClosedConnections.WithLabelValues(clientLocation, status, accessKey).Inc()
179179
m.tcpConnectionDurationMs.WithLabelValues(clientLocation, status, accessKey).Observe(duration.Seconds() * 1000)
180-
m.timeToCipherMs.WithLabelValues("tcp", clientLocation, status, accessKey).Observe(timeToCipher.Seconds() * 1000)
180+
m.timeToCipherMs.WithLabelValues("tcp", clientLocation, accessKey).Observe(timeToCipher.Seconds() * 1000)
181181
m.dataBytes.WithLabelValues("c>p", "tcp", clientLocation, status, accessKey).Add(float64(data.ClientProxy))
182182
m.dataBytes.WithLabelValues("p>t", "tcp", clientLocation, status, accessKey).Add(float64(data.ProxyTarget))
183183
m.dataBytes.WithLabelValues("p<t", "tcp", clientLocation, status, accessKey).Add(float64(data.TargetProxy))
184184
m.dataBytes.WithLabelValues("c<p", "tcp", clientLocation, status, accessKey).Add(float64(data.ProxyClient))
185185
}
186186

187187
func (m *shadowsocksMetrics) AddUDPPacketFromClient(clientLocation, accessKey, status string, clientProxyBytes, proxyTargetBytes int, timeToCipher time.Duration) {
188-
m.timeToCipherMs.WithLabelValues("udp", clientLocation, status, accessKey).Observe(timeToCipher.Seconds() * 1000)
188+
m.timeToCipherMs.WithLabelValues("udp", clientLocation, accessKey).Observe(timeToCipher.Seconds() * 1000)
189189
m.dataBytes.WithLabelValues("c>p", "udp", clientLocation, status, accessKey).Add(float64(clientProxyBytes))
190190
m.dataBytes.WithLabelValues("p>t", "udp", clientLocation, status, accessKey).Add(float64(proxyTargetBytes))
191191
}

0 commit comments

Comments
 (0)