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/logtail
Josh Bleecher Snyder 93284209bc logtail/filch: preallocate a scanner buffer
Scanning log lines is a frequent source of allocations.
Pre-allocate a re-usable buffer.

This still doesn't help when there are giant log lines.
Those will still be problematic from an iOS memory perspective.
For more on that, see https://github.com/tailscale/corp/issues/2423.

(For those who cannot follow that link, it is a discussion
of particular problematic types of log lines for
particular categories of customers. The "categories of customers"
part is the reason that it is a private issue.)

There is also a latent bug here. If we ever encounter
a log line longer than bufio.MaxScanTokenSize,
then bufio.Scan will return an error,
and we'll truncate the file and discard the rest of the log.
That's not good, but bufio.MaxScanTokenSize is really big,
so it probably doesn't matter much in practice now.
Unfortunately, it does prevent us from easily capping the potential
memory usage here, on pain of losing log entries.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
3 years ago
..
backoff backoff: update to Go style, document a bit, make 30s explicit 4 years ago
example logtail, logpolicy: remove an unidiomatic use of an interface 4 years ago
filch logtail/filch: preallocate a scanner buffer 3 years ago
.gitignore Move Linux client & common packages into a public repo. 5 years ago
README.md Move Linux client & common packages into a public repo. 5 years ago
api.md Move Linux client & common packages into a public repo. 5 years ago
buffer.go logtail: rename the unused CheckLogs to DrainLogs 5 years ago
id.go logtail: reduce PublicID.UnmarshalText from 2 allocs to 0 4 years ago
id_test.go logtail: add ParsePublicID that doesn't allocate 5 years ago
logtail.go logtail: fix typo in comment 3 years ago
logtail_test.go logtail: reduce PublicID.UnmarshalText from 2 allocs to 0 4 years ago

README.md

Tailscale Logs Service

This github repository contains libraries, documentation, and examples for working with the public API of the tailscale logs service.

For a very quick introduction to the core features, read the API docs and peruse the logs reprocessing example.

For more information, write to info@tailscale.io.