func New(config Config) (*Collector, error) {
	if config.Logger == nil {
		return nil, microerror.Maskf(invalidConfigError, "%T.Logger must not be empty", config)
	}
	if len(config.NTPServers) == 0 {
		return nil, microerror.Maskf(invalidConfigError, "%T.NTPServers must not be empty", config)
	}
	var err error
	var latencyHistogramVec *histogramvec.HistogramVec
	{
		c := histogramvec.Config{
			BucketLimits: prometheus.ExponentialBuckets(bucketStart, bucketFactor, numBuckets),
		}
		latencyHistogramVec, err = histogramvec.New(c)
		if err != nil {
			return nil, microerror.Mask(err)
		}
	}
	errorCount := prometheus.NewCounter(prometheus.CounterOpts{
		Name: prometheus.BuildFQName(namespace, "", "error_total"),
		Help: "Total number of internal errors.",
	})
	syncErrorCount := prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: prometheus.BuildFQName(namespace, "", "sync_error_total"),
			Help: "Total number of errors ntp syncs.",
		},
		[]string{"server"},
	)
	prometheus.MustRegister(errorCount)
	prometheus.MustRegister(syncErrorCount)
	collector := &Collector{
		logger: config.Logger,
		ntpServers: config.NTPServers,
		latencyHistogramVec:  latencyHistogramVec,
		latencyHistogramDesc: latencyHistogramDesc,
		errorCount:     errorCount,
		syncErrorCount: syncErrorCount,
	}
	return collector, nil
}
New creates a Collector, given a Config.
package ntp
import (
	"fmt"
	"sync"
	"time"
	"github.com/beevik/ntp"
	"github.com/giantswarm/exporterkit/histogramvec"
	"github.com/giantswarm/microerror"
	"github.com/giantswarm/micrologger"
	"github.com/prometheus/client_golang/prometheus"
)
const (
	namespace = "ntp"
	bucketStart  = 0.001
	bucketFactor = 2
	numBuckets   = 10
)
var (
	latencyHistogramDesc = prometheus.NewDesc(
		prometheus.BuildFQName(namespace, "", "latency_seconds"),
		"Histogram of latency of NTP sync requests.",
		[]string{"server"},
		nil,
	)
)
type Config struct {
	Logger micrologger.Logger
	NTPServers []string
}
type Collector struct {
	logger micrologger.Logger
	ntpServers []string
	latencyHistogramVec  *histogramvec.HistogramVec
	latencyHistogramDesc *prometheus.Desc
	errorCount     prometheus.Counter
	syncErrorCount *prometheus.CounterVec
}