func NewAutoScaler(c *options.AutoScalerConfig) (*AutoScaler, error) {
	newK8sClient, err := k8sclient.NewK8sClient(c.Namespace, c.Target, c.NodeLabels)
	if err != nil {
		return nil, err
	}
	healthInfo := newHealthInfo()
	healthServer := httpHealthServer{lastPollCycleHealth: healthInfo}
	return &AutoScaler{
		k8sClient:           newK8sClient,
		configMapName:       c.ConfigMap,
		defaultParams:       c.DefaultParams,
		pollPeriod:          time.Second * time.Duration(c.PollPeriodSeconds),
		clock:               clock.RealClock{},
		stopCh:              make(chan struct{}),
		readyCh:             make(chan struct{}, 1),
		lastPollCycleHealth: healthInfo,
		healthServer:        &healthServer,
		maxSyncFailures:     c.MaxSyncFailures,
		exitFn:              func() { os.Exit(1) },
	}, nil
}
NewAutoScaler returns a new AutoScaler
package autoscaler
import (
	"os"
	"time"
	v1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/util/clock"
	"github.com/kubernetes-sigs/cluster-proportional-autoscaler/cmd/cluster-proportional-autoscaler/options"
	"github.com/kubernetes-sigs/cluster-proportional-autoscaler/pkg/autoscaler/controller"
	"github.com/kubernetes-sigs/cluster-proportional-autoscaler/pkg/autoscaler/controller/plugin"
	"github.com/kubernetes-sigs/cluster-proportional-autoscaler/pkg/autoscaler/k8sclient"
	"github.com/golang/glog"
)
type AutoScaler struct {
	k8sClient           k8sclient.K8sClient
	controller          controller.Controller
	configMapName       string
	defaultParams       map[string]string
	pollPeriod          time.Duration
	clock               clock.Clock
	stopCh              chan struct{}
	readyCh             chan<- struct{}  
	healthServer        HealthServer
	lastPollCycleHealth *healthInfo
	maxSyncFailures     int
	exitFn              func()
}