@@ -45,7 +45,6 @@ type outlineMetrics struct {
45
45
timeToCipherMs * prometheus.HistogramVec
46
46
// TODO: Add time to first byte.
47
47
48
- keyTime * prometheus.CounterVec
49
48
IPKeyTimePerKey * prometheus.CounterVec
50
49
IPKeyTimePerLocation * prometheus.CounterVec
51
50
@@ -206,11 +205,6 @@ func newPrometheusOutlineMetrics(ip2info ipinfo.IPInfoMap, registerer prometheus
206
205
float64 (7 * 24 * time .Hour .Milliseconds ()), // Week
207
206
},
208
207
}, []string {"status" }),
209
- keyTime : prometheus .NewCounterVec (prometheus.CounterOpts {
210
- Namespace : "shadowsocks" ,
211
- Name : "key_connectivity_seconds" ,
212
- Help : "Time at least 1 connection was open, per key" ,
213
- }, []string {"access_key" }),
214
208
IPKeyTimePerKey : prometheus .NewCounterVec (prometheus.CounterOpts {
215
209
Namespace : "shadowsocks" ,
216
210
Name : "ip_key_connectivity_seconds" ,
@@ -267,7 +261,7 @@ func newPrometheusOutlineMetrics(ip2info ipinfo.IPInfoMap, registerer prometheus
267
261
// TODO: Is it possible to pass where to register the collectors?
268
262
registerer .MustRegister (m .buildInfo , m .accessKeys , m .ports , m .tcpProbes , m .tcpOpenConnections , m .tcpClosedConnections , m .tcpConnectionDurationMs ,
269
263
m .dataBytes , m .dataBytesPerLocation , m .timeToCipherMs , m .udpPacketsFromClientPerLocation , m .udpAddedNatEntries , m .udpRemovedNatEntries ,
270
- m .keyTime , m . IPKeyTimePerKey , m .IPKeyTimePerLocation )
264
+ m .IPKeyTimePerKey , m .IPKeyTimePerLocation )
271
265
return m
272
266
}
273
267
@@ -291,7 +285,6 @@ func (m *outlineMetrics) AddOpenTCPConnection(addr net.Addr) {
291
285
292
286
// Reports total time connected, by access key and by country.
293
287
func (m * outlineMetrics ) reportIPKeyActivity (ipKey IPKey , duration time.Duration ) {
294
- // TODO: Figure out how we're going to track m.keyTime
295
288
m .IPKeyTimePerKey .WithLabelValues (ipKey .accessKey ).Add (duration .Seconds ())
296
289
ip := net .ParseIP (ipKey .ip )
297
290
clientInfo , err := ipinfo .GetIPInfoFromIP (m .IPInfoMap , ip )
0 commit comments