func CaptureRuntimeMemStats(registry RootRegistry, collectionFreq time.Duration) {
	runtimeMemStats.Do(func() {
		if reg, ok := registry.(*rootRegistry); ok {
			goRegistry := metrics.NewPrefixedChildRegistry(reg.registry, "go.")
			metrics.RegisterRuntimeMemStats(goRegistry)
			go metrics.CaptureRuntimeMemStats(goRegistry, collectionFreq)
		}
	})
}
// CaptureRuntimeMemStats registers runtime memory metrics collectors and spawns
// a goroutine which collects them every collectionFreq. This function can only be called once per lifetime of the
// process and only records metrics if the provided RootRegistry is a *rootRegistry.
//
// Deprecated: use CaptureRuntimeMemStatsWithCancel instead. CaptureRuntimeMemStatsWithCancel has the following
// advantages over this function:
//   * Does not make assumptions about the concrete struct implementing of RootRegistry
//   * Does not restrict the function to being called only once globally
//   * Supports cancellation using a provided context
//   * Can tell if provided RootRegistry does not support Go runtime metric collection based on return value
CaptureRuntimeMemStats registers runtime memory metrics collectors and spawns
a goroutine which collects them every collectionFreq. This function can only be called once per lifetime of the
process and only records metrics if the provided RootRegistry is a *rootRegistry.

use CaptureRuntimeMemStatsWithCancel instead. CaptureRuntimeMemStatsWithCancel has the following
advantages over this function:
Does not make assumptions about the concrete struct implementing of RootRegistry
Does not restrict the function to being called only once globally
Supports cancellation using a provided context
Can tell if provided RootRegistry does not support Go runtime metric collection based on return value
// CaptureRuntimeMemStats registers runtime memory metrics collectors and spawns // a goroutine which collects them every collectionFreq . This function can only be called once per lifetime of the // process and only records metrics if the provided RootRegistry is a * rootRegistry . // // Deprecated : use CaptureRuntimeMemStatsWithCancel instead . CaptureRuntimeMemStatsWithCancel has the following // advantages over this function : // * Does not make assumptions about the concrete struct implementing of RootRegistry // * Does not restrict the function to being called only once globally // * Supports cancellation using a provided context // * Can tell if provided RootRegistry does not support Go runtime metric collection based on return value
func CaptureRuntimeMemStats(registry RootRegistry, collectionFreq time.Duration) {
	runtimeMemStats.Do(func() {
		if reg, ok := registry.(*rootRegistry); ok {
			goRegistry := metrics.NewPrefixedChildRegistry(reg.registry, "go.")
			metrics.RegisterRuntimeMemStats(goRegistry)
			go metrics.CaptureRuntimeMemStats(goRegistry, collectionFreq)
		}
	})
}
func CaptureRuntimeMemStats ( registry RootRegistry , collectionFreq time . Duration ) { runtimeMemStats . Do ( func ( ) { if reg , ok := registry . ( * rootRegistry ) ; ok { goRegistry := metrics . NewPrefixedChildRegistry ( reg . registry , " " ) metrics . RegisterRuntimeMemStats ( goRegistry ) go metrics . CaptureRuntimeMemStats ( goRegistry , collectionFreq ) } } ) }
CaptureRuntimeMemStats registers runtime memory metrics collectors and spawns
a goroutine which collects them every collectionFreq.
CaptureRuntimeMemStats registers runtime memory metrics collectors and spawns a goroutine which collects them every collectionFreq .