MCPcopy
hub / github.com/grafana/dskit / setupDefaultMemcachedClient

Function setupDefaultMemcachedClient

cache/memcached_client_test.go:397–422  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

395}
396
397func setupDefaultMemcachedClient() (*MemcachedClient, *mockMemcachedClientBackend, error) {
398 backend := newMockMemcachedClientBackend()
399 client, err := newMemcachedClient(
400 log.NewNopLogger(),
401 backend,
402 &mockServerSelector{
403 servers: []mockServer{
404 {
405 addr: "127.0.0.1:11211",
406 },
407 {
408 addr: "127.0.0.2:11211",
409 },
410 },
411 },
412 MemcachedClientConfig{
413 Addresses: []string{"localhost"},
414 MaxAsyncConcurrency: 1,
415 MaxAsyncBufferSize: 10,
416 },
417 prometheus.NewPedanticRegistry(),
418 "test",
419 )
420
421 return client, backend, err
422}
423
424type mockMemcachedClientBackend struct {
425 allocations int

Calls 2

newMemcachedClientFunction · 0.85

Tested by

no test coverage detected