@@ -105,7 +105,7 @@ func NewShadowsocksMetrics(ipCountryDB *geoip2.Reader) ShadowsocksMetrics {
105
105
Name : "time_to_cipher_ms" ,
106
106
Help : "Time needed to find the cipher" ,
107
107
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" }),
109
109
udpAddedNatEntries : prometheus .NewCounter (
110
110
prometheus.CounterOpts {
111
111
Namespace : "shadowsocks" ,
@@ -177,15 +177,15 @@ func (m *shadowsocksMetrics) AddOpenTCPConnection(clientLocation string) {
177
177
func (m * shadowsocksMetrics ) AddClosedTCPConnection (clientLocation , accessKey , status string , data ProxyMetrics , timeToCipher , duration time.Duration ) {
178
178
m .tcpClosedConnections .WithLabelValues (clientLocation , status , accessKey ).Inc ()
179
179
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 )
181
181
m .dataBytes .WithLabelValues ("c>p" , "tcp" , clientLocation , status , accessKey ).Add (float64 (data .ClientProxy ))
182
182
m .dataBytes .WithLabelValues ("p>t" , "tcp" , clientLocation , status , accessKey ).Add (float64 (data .ProxyTarget ))
183
183
m .dataBytes .WithLabelValues ("p<t" , "tcp" , clientLocation , status , accessKey ).Add (float64 (data .TargetProxy ))
184
184
m .dataBytes .WithLabelValues ("c<p" , "tcp" , clientLocation , status , accessKey ).Add (float64 (data .ProxyClient ))
185
185
}
186
186
187
187
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 )
189
189
m .dataBytes .WithLabelValues ("c>p" , "udp" , clientLocation , status , accessKey ).Add (float64 (clientProxyBytes ))
190
190
m .dataBytes .WithLabelValues ("p>t" , "udp" , clientLocation , status , accessKey ).Add (float64 (proxyTargetBytes ))
191
191
}
0 commit comments