mirror of
https://github.com/tailscale/tailscale.git
synced 2025-05-07 16:16:54 +00:00
ipn/ipnlocal: add client metric gauge for number of IPNBus connections
Updates #1708 Change-Id: Ic7e28d692b4c48e78c842c26234b861fe42a916e Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
c81a95dd53
commit
8d6b996483
@ -95,6 +95,7 @@ import (
|
|||||||
"tailscale.com/types/preftype"
|
"tailscale.com/types/preftype"
|
||||||
"tailscale.com/types/ptr"
|
"tailscale.com/types/ptr"
|
||||||
"tailscale.com/types/views"
|
"tailscale.com/types/views"
|
||||||
|
"tailscale.com/util/clientmetric"
|
||||||
"tailscale.com/util/deephash"
|
"tailscale.com/util/deephash"
|
||||||
"tailscale.com/util/dnsname"
|
"tailscale.com/util/dnsname"
|
||||||
"tailscale.com/util/goroutines"
|
"tailscale.com/util/goroutines"
|
||||||
@ -2863,6 +2864,9 @@ func (b *LocalBackend) WatchNotificationsAs(ctx context.Context, actor ipnauth.A
|
|||||||
mak.Set(&b.notifyWatchers, sessionID, session)
|
mak.Set(&b.notifyWatchers, sessionID, session)
|
||||||
b.mu.Unlock()
|
b.mu.Unlock()
|
||||||
|
|
||||||
|
metricCurrentWatchIPNBus.Add(1)
|
||||||
|
defer metricCurrentWatchIPNBus.Add(-1)
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
b.mu.Lock()
|
b.mu.Lock()
|
||||||
delete(b.notifyWatchers, sessionID)
|
delete(b.notifyWatchers, sessionID)
|
||||||
@ -7696,3 +7700,7 @@ func (b *LocalBackend) vipServicesFromPrefsLocked(prefs ipn.PrefsView) []*tailcf
|
|||||||
|
|
||||||
return slicesx.MapValues(services)
|
return slicesx.MapValues(services)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
metricCurrentWatchIPNBus = clientmetric.NewGauge("localbackend_current_watch_ipn_bus")
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user