Example #1
0
func newGCMetricaDataSource(pollInterval int) goMetricaDataSource {
	r := metrics.NewRegistry()

	metrics.RegisterDebugGCStats(r)
	go metrics.CaptureDebugGCStats(r, time.Duration(pollInterval)*time.Second)
	return goMetricaDataSource{r}
}
Example #2
0
func (s *stats) start() {
	// Register GC stats.
	registerGCStats(s.registry)
	go captureGCStats(s.registry, recordInterval)

	// Register rusage stats.
	registerRusageStats(s.registry)
	go captureRusageStats(s.registry, recordInterval)

	// Register debug stats.
	metrics.RegisterDebugGCStats(s.registry)
	go metrics.CaptureDebugGCStats(s.registry, recordInterval)

	// Register runtime stats.
	metrics.RegisterRuntimeMemStats(s.registry)
	go metrics.CaptureRuntimeMemStats(s.registry, recordInterval)

	// Start monitoring
	go s.monitor()
}