Skip to content

Commit d0a5abd

Browse files
committed
client: imp naming
1 parent 5accdca commit d0a5abd

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

internal/client/storage.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ type FindParams struct {
464464
UID UID
465465
}
466466

467-
// ErrBadIdentifier is returned by [ClearAndSet] when it cannot parse the
467+
// ErrBadIdentifier is returned by [FindParams.Set] when it cannot parse the
468468
// provided client identifier.
469469
const ErrBadIdentifier errors.Error = "bad client identifier"
470470

internal/client/storage_test.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ func TestStorage_CustomUpstreamConfig(t *testing.T) {
12631263
})
12641264
}
12651265

1266-
func BenchmarkClearAndSet(b *testing.B) {
1266+
func BenchmarkFindParams_Set(b *testing.B) {
12671267
const (
12681268
testIPStr = "192.0.2.1"
12691269
testCIDRStr = "192.0.2.0/24"
@@ -1332,14 +1332,14 @@ func BenchmarkClearAndSet(b *testing.B) {
13321332
// goarch: amd64
13331333
// pkg: github.com/AdguardTeam/AdGuardHome/internal/client
13341334
// cpu: Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
1335-
// BenchmarkClearAndSet/client_id-8 49463488 24.27 ns/op 0 B/op 0 allocs/op
1336-
// BenchmarkClearAndSet/ip_address-8 18740977 62.22 ns/op 0 B/op 0 allocs/op
1337-
// BenchmarkClearAndSet/subnet-8 10848192 110.0 ns/op 0 B/op 0 allocs/op
1338-
// BenchmarkClearAndSet/mac_address-8 8148494 133.2 ns/op 8 B/op 1 allocs/op
1339-
// BenchmarkClearAndSet/bad_id-8 73894278 16.29 ns/op 0 B/op 0 allocs/op
1335+
// BenchmarkFindParams_Set/client_id-8 49463488 24.27 ns/op 0 B/op 0 allocs/op
1336+
// BenchmarkFindParams_Set/ip_address-8 18740977 62.22 ns/op 0 B/op 0 allocs/op
1337+
// BenchmarkFindParams_Set/subnet-8 10848192 110.0 ns/op 0 B/op 0 allocs/op
1338+
// BenchmarkFindParams_Set/mac_address-8 8148494 133.2 ns/op 8 B/op 1 allocs/op
1339+
// BenchmarkFindParams_Set/bad_id-8 73894278 16.29 ns/op 0 B/op 0 allocs/op
13401340
}
13411341

1342-
func BenchmarkFind(b *testing.B) {
1342+
func BenchmarkStorage_Find(b *testing.B) {
13431343
const (
13441344
cliID = "cid"
13451345
cliMAC = "02:00:00:00:00:00"
@@ -1436,8 +1436,8 @@ func BenchmarkFind(b *testing.B) {
14361436
// goarch: amd64
14371437
// pkg: github.com/AdguardTeam/AdGuardHome/internal/client
14381438
// cpu: Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
1439-
// BenchmarkFind/client_id-8 6945201 157.4 ns/op 240 B/op 2 allocs/op
1440-
// BenchmarkFind/ip_address-8 7000094 165.3 ns/op 248 B/op 2 allocs/op
1441-
// BenchmarkFind/subnet-8 6872064 163.6 ns/op 256 B/op 2 allocs/op
1442-
// BenchmarkFind/mac_address-8 5693320 205.2 ns/op 256 B/op 3 allocs/op
1439+
// BenchmarkStorage_Find/client_id-8 7070107 154.4 ns/op 240 B/op 2 allocs/op
1440+
// BenchmarkStorage_Find/ip_address-8 6831823 168.6 ns/op 248 B/op 2 allocs/op
1441+
// BenchmarkStorage_Find/subnet-8 7209050 167.5 ns/op 256 B/op 2 allocs/op
1442+
// BenchmarkStorage_Find/mac_address-8 5776131 199.7 ns/op 256 B/op 3 allocs/op
14431443
}

0 commit comments

Comments
 (0)