MCPcopy
hub / github.com/grafana/tempo / NewClient

Function NewClient

modules/cache/memcached/memcached.go:18–36  ·  view source on GitHub ↗
(cfg *Config, cfgBackground *cache.BackgroundConfig, name string, logger log.Logger)

Source from the content-addressed store, hash-verified

16}
17
18func NewClient(cfg *Config, cfgBackground *cache.BackgroundConfig, name string, logger log.Logger) cache.Cache {
19 if cfg.ClientConfig.MaxIdleConns == 0 {
20 cfg.ClientConfig.MaxIdleConns = 16
21 }
22 if cfg.ClientConfig.Timeout == 0 {
23 cfg.ClientConfig.Timeout = 100 * time.Millisecond
24 }
25 if cfg.ClientConfig.UpdateInterval == 0 {
26 cfg.ClientConfig.UpdateInterval = time.Minute
27 }
28
29 client := cache.NewMemcachedClient(cfg.ClientConfig, name, prometheus.DefaultRegisterer, logger)
30 memcachedCfg := cache.MemcachedConfig{
31 Expiration: cfg.TTL,
32 }
33 c := cache.NewMemcached(memcachedCfg, client, name, cfg.ClientConfig.MaxItemSize, prometheus.DefaultRegisterer, logger)
34
35 return cache.NewBackground(name, *cfgBackground, c, prometheus.DefaultRegisterer)
36}

Callers 2

createLegacyCacheFunction · 0.92
NewProviderFunction · 0.92

Calls 3

NewMemcachedClientFunction · 0.92
NewMemcachedFunction · 0.92
NewBackgroundFunction · 0.92

Tested by

no test coverage detected