MCPcopy
hub / github.com/prometheus/client_golang / startSparkForge

Function startSparkForge

examples/customlabels/main.go:82–95  ·  view source on GitHub ↗
(reg prometheus.Registerer)

Source from the content-addressed store, hash-verified

80}
81
82func startSparkForge(reg prometheus.Registerer) {
83 itemsForged := promauto.With(reg).NewCounter(prometheus.CounterOpts{
84 Name: "items_forged_total",
85 Help: "Total number of items forged",
86 })
87
88 go func() {
89 for {
90 time.Sleep(6 * time.Second)
91 itemsForged.Inc()
92 log.Println("SparkForge forged an item")
93 }
94 }()
95}

Callers 1

mainFunction · 0.85

Calls 4

IncMethod · 0.95
WithFunction · 0.92
NewCounterMethod · 0.80
PrintlnMethod · 0.65

Tested by

no test coverage detected