Skip to content

Commit 0520fd2

Browse files
committed
Remove key_connectivity_seconds for the time being.
1 parent f49c40d commit 0520fd2

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

cmd/outline-ss-server/metrics.go

+1-8
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ type outlineMetrics struct {
4545
timeToCipherMs *prometheus.HistogramVec
4646
// TODO: Add time to first byte.
4747

48-
keyTime *prometheus.CounterVec
4948
IPKeyTimePerKey *prometheus.CounterVec
5049
IPKeyTimePerLocation *prometheus.CounterVec
5150

@@ -206,11 +205,6 @@ func newPrometheusOutlineMetrics(ip2info ipinfo.IPInfoMap, registerer prometheus
206205
float64(7 * 24 * time.Hour.Milliseconds()), // Week
207206
},
208207
}, []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"}),
214208
IPKeyTimePerKey: prometheus.NewCounterVec(prometheus.CounterOpts{
215209
Namespace: "shadowsocks",
216210
Name: "ip_key_connectivity_seconds",
@@ -267,7 +261,7 @@ func newPrometheusOutlineMetrics(ip2info ipinfo.IPInfoMap, registerer prometheus
267261
// TODO: Is it possible to pass where to register the collectors?
268262
registerer.MustRegister(m.buildInfo, m.accessKeys, m.ports, m.tcpProbes, m.tcpOpenConnections, m.tcpClosedConnections, m.tcpConnectionDurationMs,
269263
m.dataBytes, m.dataBytesPerLocation, m.timeToCipherMs, m.udpPacketsFromClientPerLocation, m.udpAddedNatEntries, m.udpRemovedNatEntries,
270-
m.keyTime, m.IPKeyTimePerKey, m.IPKeyTimePerLocation)
264+
m.IPKeyTimePerKey, m.IPKeyTimePerLocation)
271265
return m
272266
}
273267

@@ -291,7 +285,6 @@ func (m *outlineMetrics) AddOpenTCPConnection(addr net.Addr) {
291285

292286
// Reports total time connected, by access key and by country.
293287
func (m *outlineMetrics) reportIPKeyActivity(ipKey IPKey, duration time.Duration) {
294-
// TODO: Figure out how we're going to track m.keyTime
295288
m.IPKeyTimePerKey.WithLabelValues(ipKey.accessKey).Add(duration.Seconds())
296289
ip := net.ParseIP(ipKey.ip)
297290
clientInfo, err := ipinfo.GetIPInfoFromIP(m.IPInfoMap, ip)

0 commit comments

Comments
 (0)