From 19b8ce07cefe6e7e7ca16a9098a2d6733afb6f7c Mon Sep 17 00:00:00 2001 From: fortuna Date: Wed, 19 Dec 2018 10:08:26 -0500 Subject: [PATCH] Remove status from cipher time --- metrics/metrics.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/metrics/metrics.go b/metrics/metrics.go index 460d56ba..016e1870 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -105,7 +105,7 @@ func NewShadowsocksMetrics(ipCountryDB *geoip2.Reader) ShadowsocksMetrics { Name: "time_to_cipher_ms", Help: "Time needed to find the cipher", Objectives: map[float64]float64{0.5: 0.02, 0.9: 0.01, 0.99: 0.005}, - }, []string{"proto", "location", "status", "access_key"}), + }, []string{"proto", "location", "access_key"}), udpAddedNatEntries: prometheus.NewCounter( prometheus.CounterOpts{ Namespace: "shadowsocks", @@ -177,7 +177,7 @@ func (m *shadowsocksMetrics) AddOpenTCPConnection(clientLocation string) { func (m *shadowsocksMetrics) AddClosedTCPConnection(clientLocation, accessKey, status string, data ProxyMetrics, timeToCipher, duration time.Duration) { m.tcpClosedConnections.WithLabelValues(clientLocation, status, accessKey).Inc() m.tcpConnectionDurationMs.WithLabelValues(clientLocation, status, accessKey).Observe(duration.Seconds() * 1000) - m.timeToCipherMs.WithLabelValues("tcp", clientLocation, status, accessKey).Observe(timeToCipher.Seconds() * 1000) + m.timeToCipherMs.WithLabelValues("tcp", clientLocation, accessKey).Observe(timeToCipher.Seconds() * 1000) m.dataBytes.WithLabelValues("c>p", "tcp", clientLocation, status, accessKey).Add(float64(data.ClientProxy)) m.dataBytes.WithLabelValues("p>t", "tcp", clientLocation, status, accessKey).Add(float64(data.ProxyTarget)) m.dataBytes.WithLabelValues("pp", "udp", clientLocation, status, accessKey).Add(float64(clientProxyBytes)) m.dataBytes.WithLabelValues("p>t", "udp", clientLocation, status, accessKey).Add(float64(proxyTargetBytes)) }