@@ -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) {
177177func (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
187187func (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