func (cms *containerMetrics) SetSink(sink core.Sink) {
	cms.sink = sink
}
SetSink sets the Sink for the produced metrics.
package factory
import (
	"context"
	containerGraph "github.com/pesos/grofer/pkg/sink/tui/container"
	"github.com/docker/docker/client"
	"github.com/pesos/grofer/pkg/core"
	"github.com/pesos/grofer/pkg/metrics/container"
	"github.com/pesos/grofer/pkg/utils"
	"golang.org/x/sync/errgroup"
)
type containerMetrics struct {
	client      *client.Client
	all         bool
	refreshRate uint64
	sink        core.Sink  
	metricBus   chan container.OverallMetrics
}
func (cms *containerMetrics) Serve(opts ...Option) error {
	for _, opt := range opts {
		opt(cms)
	}
	eg, ctx := errgroup.WithContext(context.Background())
	eg.Go(func() error {
		return utils.TickUntilDone(ctx, cms.refreshRate, func() error {
			metrics, err := container.GetOverallMetrics(ctx, cms.client, cms.all)
			if err != nil {
				return err
			}
			select {
			case <-ctx.Done():
				return ctx.Err()
			case cms.metricBus <- metrics:
			}
			return nil
		})
	})
	switch cms.sink {
	case core.TUI:
		eg.Go(func() error {
			return containerGraph.OverallVisuals(ctx, cms.client, cms.all, cms.metricBus, cms.refreshRate)
		})
	}
	return eg.Wait()
}