You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/util
Mihai Parparita f49b9f75b8 util/clientmetric: allow client metric values to be provided by a function
Adds NewGaugeFunc and NewCounterFunc (inspired by expvar.Func) which
change the current value to be reported by a function. This allows
some client metric values to be computed on-demand during uploading (at
most every 15 seconds), instead of being continuously updated.

clientmetric uploading had a bunch of micro-optimizations for memory
access (#3331) which are not possible with this approach. However, any
performance hit from function-based metrics is contained to those metrics
only, and we expect to have very few.

Also adds a DisableDeltas() option for client metrics, so that absolute
values are always reported. This makes server-side processing of some
metrics easier to reason about.

Updates tailscale/corp#9230

Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2 years ago
..
cibuild all: update copyright and license headers 2 years ago
clientmetric util/clientmetric: allow client metric values to be provided by a function 2 years ago
cloudenv all: update copyright and license headers 2 years ago
cmpver all: update copyright and license headers 2 years ago
codegen util/codegen: add -copyright to control presence of copyright headers 2 years ago
cstruct all: update copyright and license headers 2 years ago
deephash tailcfg: add Node.SelfNodeV4MasqAddrForThisPeer 2 years ago
dirwalk all: use tstest.Replace more 2 years ago
dnsname cmd/tailscale: extend hostname validation (#7678) 2 years ago
goroutines all: update copyright and license headers 2 years ago
groupmember all: update copyright and license headers 2 years ago
hashx all: update copyright and license headers 2 years ago
httpm all: update copyright and license headers 2 years ago
jsonutil all: update copyright and license headers 2 years ago
lineread all: update copyright and license headers 2 years ago
linuxfw util/linuxfw: add build constraints excluding GOARCH=arm 2 years ago
mak all: update copyright and license headers 2 years ago
multierr util/multierr: implement Go 1.20+'s multiple error Unwrap 2 years ago
must all: update copyright and license headers 2 years ago
osshare all: update copyright and license headers 2 years ago
pidowner all: update copyright and license headers 2 years ago
precompress all: update copyright and license headers 2 years ago
quarantine all: update copyright and license headers 2 years ago
racebuild all: update copyright and license headers 2 years ago
ringbuffer util/ringbuffer: move generic ringbuffer from corp repo 2 years ago
set all: update copyright and license headers 2 years ago
singleflight all: update copyright and license headers 2 years ago
slicesx util/slicesx: add package for generic slice functions, use 2 years ago
sysresources util/sysresources, magicsock: scale DERP buffer based on system memory 2 years ago
systemd all: update copyright and license headers 2 years ago
truncate util: add truncate package (#7490) 2 years ago
uniq all: update copyright and license headers 2 years ago
vizerror util/vizerror: add As function to get wrapped Error 2 years ago
winutil ipn/ipnlocal, util/winutil/policy: modify Windows profile migration to load legacy prefs from within tailscaled 2 years ago