Skip to content

Commit

Permalink
Remove key_connectivity_seconds for the time being.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Mar 15, 2024
1 parent f49c40d commit 0520fd2
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions cmd/outline-ss-server/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ type outlineMetrics struct {
timeToCipherMs *prometheus.HistogramVec
// TODO: Add time to first byte.

keyTime *prometheus.CounterVec
IPKeyTimePerKey *prometheus.CounterVec
IPKeyTimePerLocation *prometheus.CounterVec

Expand Down Expand Up @@ -206,11 +205,6 @@ func newPrometheusOutlineMetrics(ip2info ipinfo.IPInfoMap, registerer prometheus
float64(7 * 24 * time.Hour.Milliseconds()), // Week
},
}, []string{"status"}),
keyTime: prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "shadowsocks",
Name: "key_connectivity_seconds",
Help: "Time at least 1 connection was open, per key",
}, []string{"access_key"}),
IPKeyTimePerKey: prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "shadowsocks",
Name: "ip_key_connectivity_seconds",
Expand Down Expand Up @@ -267,7 +261,7 @@ func newPrometheusOutlineMetrics(ip2info ipinfo.IPInfoMap, registerer prometheus
// TODO: Is it possible to pass where to register the collectors?
registerer.MustRegister(m.buildInfo, m.accessKeys, m.ports, m.tcpProbes, m.tcpOpenConnections, m.tcpClosedConnections, m.tcpConnectionDurationMs,
m.dataBytes, m.dataBytesPerLocation, m.timeToCipherMs, m.udpPacketsFromClientPerLocation, m.udpAddedNatEntries, m.udpRemovedNatEntries,
m.keyTime, m.IPKeyTimePerKey, m.IPKeyTimePerLocation)
m.IPKeyTimePerKey, m.IPKeyTimePerLocation)
return m
}

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

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

0 comments on commit 0520fd2

Please sign in to comment.