Logo
Explore Help
Sign In
TheArchive/tailscale
1
0
Fork 0
You've already forked tailscale
mirror of https://github.com/tailscale/tailscale.git synced 2025-05-09 17:16:50 +00:00
Code Issues Packages Projects Releases Wiki Activity
tailscale/version/distro/distro_test.go

17 lines
324 B
Go
Raw Normal View History

version, hostinfo: recognize gokrazy as a distro Now: /tmp/breakglass3929186798 # /user/tailscale debug hostinfo { "IPNVersion": "1.23.0-date.20220107", "OS": "linux", "OSVersion": "Gokrazy; kernel=5.16.11", "DeviceModel": "Raspberry Pi 4 Model B Rev 1.2", "Hostname": "gokrazy", "GoArch": "arm64" } Also, cache the distro lookup. It doesn't change while the program is running: name old time/op new time/op delta Get-6 5.21µs ± 5% 0.00µs ± 3% -99.91% (p=0.008 n=5+5) name old alloc/op new alloc/op delta Get-6 792B ± 0% 0B -100.00% (p=0.008 n=5+5) name old allocs/op new allocs/op delta Get-6 8.00 ± 0% 0.00 -100.00% (p=0.008 n=5+5) Updates #1866 Change-Id: Ifb9a63b94287010d3f4c8bfeb6b78119e8a9b203 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-03-01 19:26:57 -08:00
// Copyright (c) 2022 Tailscale Inc & AUTHORS All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package distro
import "testing"
func BenchmarkGet(b *testing.B) {
b.ReportAllocs()
var d Distro
for i := 0; i < b.N; i++ {
d = Get()
}
_ = d
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.6 Page: 137ms Template: 5ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API