func New(base mb.BaseMetricSet) (mb.MetricSet, error) {
	cfgwarn.Beta("The containerd cpu metricset is beta.")

	pc, err := prometheus.NewPrometheusClient(base)
	if err != nil {
		return nil, err
	}
	config := containerd.DefaultConfig()
	if err := base.Module().UnpackConfig(&config); err != nil {
		return nil, err
	}

	mod, ok := base.Module().(containerd.Module)
	if !ok {
		return nil, fmt.Errorf("must be child of kubernetes module")
	}
	return &metricset{
		BaseMetricSet:    base,
		prometheusClient: pc,
		mod:              mod,
		calcPct:          config.CalculateMemPct,
	}, nil
}
// New creates a new instance of the MetricSet. New is responsible for unpacking
// any MetricSet specific configuration options if there are any.
New creates a new instance of the MetricSet. New is responsible for unpacking
any MetricSet specific configuration options if there are any.
// New creates a new instance of the MetricSet . New is responsible for unpacking // any MetricSet specific configuration options if there are any .
func New(base mb.BaseMetricSet) (mb.MetricSet, error) {
	cfgwarn.Beta("The containerd cpu metricset is beta.")
	pc, err := prometheus.NewPrometheusClient(base)
	if err != nil {
		return nil, err
	}
	config := containerd.DefaultConfig()
	if err := base.Module().UnpackConfig(&config); err != nil {
		return nil, err
	}
	mod, ok := base.Module().(containerd.Module)
	if !ok {
		return nil, fmt.Errorf("must be child of kubernetes module")
	}
	return &metricset{
		BaseMetricSet:    base,
		prometheusClient: pc,
		mod:              mod,
		calcPct:          config.CalculateMemPct,
	}, nil
}
func New ( base mb . BaseMetricSet ) ( mb . MetricSet , error ) { cfgwarn . Beta ( " " ) pc , err := prometheus . NewPrometheusClient ( base ) if err != nil { return nil , err } config := containerd . DefaultConfig ( ) if err := base . Module ( ) . UnpackConfig ( & config ) ; err != nil { return nil , err } mod , ok := base . Module ( ) . ( containerd . Module ) if ! ok { return nil , fmt . Errorf ( " " ) } return & metricset { BaseMetricSet : base , prometheusClient : pc , mod : mod , calcPct : config . CalculateMemPct , } , nil }
New creates a new instance of the MetricSet.
New creates a new instance of the MetricSet .