Skip to content

Commit ced36bd

Browse files
committed
Update comments and log.
1 parent 7cb66b3 commit ced36bd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cmd/outline-ss-server/metrics.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ func (c *tunnelTimeCollector) Describe(ch chan<- *prometheus.Desc) {
9797
ch <- c.tunnelTimePerLocation
9898
}
9999

100-
// Collects time connected for all active clients.
101100
func (c *tunnelTimeCollector) Collect(ch chan<- prometheus.Metric) {
102101
c.mu.Lock()
103102
defer c.mu.Unlock()
@@ -107,14 +106,14 @@ func (c *tunnelTimeCollector) Collect(ch chan<- prometheus.Metric) {
107106
if client.connCount > 0 {
108107
connDuration += tNow.Sub(client.startTime)
109108
}
110-
logger.Debugf("Reporting activity for key `%v`, duration: %v", ipKey.accessKey, connDuration)
109+
logger.Debugf("Collecting TunnelTime for key `%v`, duration: %v", ipKey.accessKey, connDuration)
111110
ch <- prometheus.MustNewConstMetric(c.tunnelTimePerKey, prometheus.CounterValue, connDuration.Seconds(), ipKey.accessKey)
112111
ch <- prometheus.MustNewConstMetric(c.tunnelTimePerLocation, prometheus.CounterValue, connDuration.Seconds(), client.info.CountryCode.String(), asnLabel(client.info.ASN))
113112
if client.connCount == 0 {
114113
delete(c.activeClients, ipKey)
115114
continue
116115
}
117-
// Reset the start time now that it's been reported.
116+
// Reset the timing components now that TunnelTime has been reported.
118117
client.startTime = tNow
119118
client.connDuration = 0
120119
}

0 commit comments

Comments
 (0)