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

Function BuildStats

pkg/usagestats/stats.go:85–110  ·  view source on GitHub ↗

BuildStats builds the report without cluster seed data

()

Source from the content-addressed store, hash-verified

83
84// BuildStats builds the report without cluster seed data
85func BuildStats() Report {
86 var (
87 targetName string
88 editionName string
89 )
90 if target := expvar.Get(statsPrefix + targetKey); target != nil {
91 if target, ok := target.(*expvar.String); ok {
92 targetName = target.Value()
93 }
94 }
95 if edition := expvar.Get(statsPrefix + editionKey); edition != nil {
96 if edition, ok := edition.(*expvar.String); ok {
97 editionName = edition.Value()
98 }
99 }
100
101 return Report{
102 PrometheusVersion: build.GetVersion(),
103 IntervalPeriod: reportInterval.Seconds(),
104 Os: runtime.GOOS,
105 Arch: runtime.GOARCH,
106 Target: targetName,
107 Edition: editionName,
108 Metrics: buildMetrics(),
109 }
110}
111
112// buildMetrics builds the metrics part of the report to be sent to the stats server
113func buildMetrics() map[string]interface{} {

Callers 3

usageStatsHandlerFunction · 0.92
Test_BuildStatsFunction · 0.85
buildReportFunction · 0.85

Calls 4

buildMetricsFunction · 0.85
GetMethod · 0.65
ValueMethod · 0.45
GetVersionMethod · 0.45

Tested by 1

Test_BuildStatsFunction · 0.68