func()

in prometheus/metrics_collector.go [29:44]


func (mc *metricCollector) updateMetrics() {
	for {
		for idx := 0; idx < mc.metricCount; idx++ {
			mc.counters[idx].Add(rand.Float64())
			mc.gauges[idx].Add(rand.Float64())
			lowerBound := math.Mod(rand.Float64(), 1)
			increment := math.Mod(rand.Float64(), 0.05)
			for i := lowerBound; i < 1; i += increment {
				mc.histograms[idx].Observe(i)
				mc.summarys[idx].Observe(i)
			}
		}
		// generate new metrics in 30 second intervals
		time.Sleep(time.Second * 30)
	}
}