summaryrefslogtreecommitdiffhomepage
path: root/types
AgeCommit message (Collapse)AuthorFilesLines
2020-07-14types/logger: fix go test vet errorElias Naur1-1/+1
Silences types/logger/logger_test.go:63:30: conversion from int to string yields a string of one rune Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-07-10wgengine/magicsock, tstest/natlab: start hooking up natlab to magicsockBrad Fitzpatrick1-0/+25
Also adds ephemeral port support to natlab. Work in progress. Pairing with @danderson.
2020-07-03types/logger: add rateFreePrefix rate-limiting-exempt log format prefixesBrad Fitzpatrick1-0/+14
Per conversation with @danderson.
2020-06-25types/opt: add Bool.EqualBool methodBrad Fitzpatrick2-0/+30
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-06-19all: generate discovery key, plumb it aroundBrad Fitzpatrick1-0/+11
Not actually used yet. Updates #483
2020-06-15Fix concurrency issues in controlclient, ipn, types/logger (#456)Dmytro Shynkevych2-1/+35
Signed-Off-By: Dmytro Shynkevych <dmytro@tailscale.com>
2020-05-29types/logger: add TS_DEBUG_LOG_RATE knob to easily turn off rate limitingBrad Fitzpatrick1-0/+6
2020-05-25types/strbuilder: add a variant of strings.Builder that uses sync.PoolBrad Fitzpatrick2-0/+126
... and thus does not need to worry about when it escapes into unprovable fmt interface{} land. Also, add some convenience methods for efficiently writing integers.
2020-05-20log rate limiting: reformat limiter messages, and use nonempty burst size.Avery Pennarun2-8/+10
- Reformat the warning about a message being rate limited to print the format string, rather than the formatted message. This helps give a clue what "type" of message is being limited. - Change the rate limit warning to be [RATE LIMITED] in all caps. This uses less space on each line, plus is more noticeable. - In tailscaled, change the frequency to be less often (once every 5 seconds per format string) but to allow bursts of up to 5 messages. This greatly reduces the number of messages that are rate limited during startup, but allows us to tighten the limit even further during normal runtime. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-15wgengine: log node IDs when peers are added/removed (#381)Wendi Yu2-18/+80
Also stop logging data sent/received from nodes we're not connected to (ie all those `x`s being logged in the `peers: ` line) Signed-off-by: Wendi <wendi.yu@yahoo.ca>
2020-05-13types/logger: add ArgWriterBrad Fitzpatrick2-0/+31
2020-05-11types/logger: simplify mutex locking in rate-limited loggerBrad Fitzpatrick1-31/+42
Updates #365 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-05-09types/logger: fix deadlock in the burst case.David Anderson2-3/+4
Fixes #365. Signed-off-by: David Anderson <danderson@tailscale.com>
2020-05-08Implement rate limiting on log messages (#356)Wendi Yu2-0/+100
Implement rate limiting on log messages Addresses issue #317, where logs can get spammed with the same message nonstop. Created a rate limiting closure on logging functions, which limits the number of messages being logged per second based on format string. To keep memory usage as constant as possible, the previous cache purging at periodic time intervals has been replaced by an LRU that discards the oldest string when the capacity of the cache is reached. Signed-off-by: Wendi Yu <wendi.yu@yahoo.ca>
2020-05-03types/structs: add structs.Incomparable annotation, use it where applicableBrad Fitzpatrick1-0/+16
Shotizam before and output queries: sqlite> select sum(size) from bin where func like 'type..%'; 129067 => 120216
2020-04-11all: remove unnecessary trailing newlines in format patterns for consistencyBrad Fitzpatrick1-0/+1
And document on logger.Logf that it's unnecessary.
2020-04-09wgengine: don't allocate so much in userspaceEngine.getStatusBrad Fitzpatrick1-0/+33
It was one of the top garbage producers on my phone. It's slated to be deleted and replaced anyway, but this helps in the meantime. The go.sum changes look scary, but the new dep only adds 240 bytes to the binary. The go.sum noise is just cmd/go being aggressive in including a lot of stuff (which is being fixed in Go 1.15, for what I understand). And I ran a go mod tidy, which added some too. (I had to write a custom wrapper around go mod tidy because this mod tidy normally breaks on tailscale.io/control being missing but referenced in tests) Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-04-06types/logger: add Discard helper.David Anderson1-0/+3
2020-03-27types/key: make Public implement TextMarshaler, TextUnmarshalerBrad Fitzpatrick2-0/+46
So it can be a map key with encoding/json
2020-03-26cmd/tailscaled, wgengine, ipn: add /debug/ipn handler with world stateBrad Fitzpatrick1-1/+12
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-03-06types/logger: add adapters for Logf to std Logger/WriterBrad Fitzpatrick2-0/+43
2020-02-28types/key: add IsZero methodsBrad Fitzpatrick1-0/+6
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-02-27types/opt: add opt package for a new opt.Bool JSON typeBrad Fitzpatrick2-0/+134
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-02-25types/logger: add WithPrefix, use it in two placesBrad Fitzpatrick1-1/+9
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-02-17derp: use new types/key packageBrad Fitzpatrick1-0/+30
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-02-14Move "logger" package to under types, now that we have it.Brad Fitzpatrick1-0/+10
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-02-14types/empty: add Message, stop using mysterious *struct{}Brad Fitzpatrick1-0/+14
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>