MCPcopy Index your code
hub / github.com/tailscale/tailscale / BenchmarkFilterMatch

Function BenchmarkFilterMatch

wgengine/filter/filter_test.go:1020–1059  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

1018}
1019
1020func BenchmarkFilterMatch(b *testing.B) {
1021 b.Run("not-local-v4", func(b *testing.B) {
1022 benchmarkFile(b, "testdata/matches-1.json", benchOpt{v4: true, validLocalDst: false})
1023 })
1024 b.Run("not-local-v6", func(b *testing.B) {
1025 benchmarkFile(b, "testdata/matches-1.json", benchOpt{v4: false, validLocalDst: false})
1026 })
1027 b.Run("no-match-v4", func(b *testing.B) {
1028 benchmarkFile(b, "testdata/matches-1.json", benchOpt{v4: true, validLocalDst: true})
1029 })
1030 b.Run("no-match-v6", func(b *testing.B) {
1031 benchmarkFile(b, "testdata/matches-1.json", benchOpt{v4: false, validLocalDst: true})
1032 })
1033 b.Run("tcp-not-syn-v4", func(b *testing.B) {
1034 benchmarkFile(b, "testdata/matches-1.json", benchOpt{
1035 v4: true,
1036 validLocalDst: true,
1037 tcpNotSYN: true,
1038 wantAccept: true,
1039 })
1040 })
1041 b.Run("udp-existing-flow-v4", func(b *testing.B) {
1042 benchmarkFile(b, "testdata/matches-1.json", benchOpt{
1043 v4: true,
1044 validLocalDst: true,
1045 udp: true,
1046 udpOpen: true,
1047 wantAccept: true,
1048 })
1049 })
1050 b.Run("tcp-not-syn-v4-no-logs", func(b *testing.B) {
1051 benchmarkFile(b, "testdata/matches-1.json", benchOpt{
1052 v4: true,
1053 validLocalDst: true,
1054 tcpNotSYN: true,
1055 wantAccept: true,
1056 noLogs: true,
1057 })
1058 })
1059}
1060
1061type benchOpt struct {
1062 v4 bool

Callers

nothing calls this directly

Calls 2

benchmarkFileFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…