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

Function NewString

pkg/usagestats/stats.go:191–200  ·  view source on GitHub ↗

NewString returns a new String stats object. If a String stats object with the same name already exists it is returned.

(name string)

Source from the content-addressed store, hash-verified

189// NewString returns a new String stats object.
190// If a String stats object with the same name already exists it is returned.
191func NewString(name string) *expvar.String {
192 existing := expvar.Get(statsPrefix + name)
193 if existing != nil {
194 if s, ok := existing.(*expvar.String); ok {
195 return s
196 }
197 panic(fmt.Sprintf("%v is set to a non-string value", name))
198 }
199 return expvar.NewString(statsPrefix + name)
200}
201
202// Target sets the target name. This can be set multiple times.
203func Target(target string) {

Callers 8

config.goFile · 0.92
store.goFile · 0.92
ring.goFile · 0.92
Test_BuildReportFunction · 0.85
Test_BuildStatsFunction · 0.85
TestPanicsFunction · 0.85
TargetFunction · 0.85
EditionFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by 3

Test_BuildReportFunction · 0.68
Test_BuildStatsFunction · 0.68
TestPanicsFunction · 0.68