// RegisterPrometheus registers all Prometheus metrics.
// It must be called only once and failing to register the metrics will lead to a panic.
482839
func RegisterPrometheus(ctx context.Context, config *types.Prometheus) Registry {
	standardRegistry := initStandardRegistry(config)

	if !registerPromState(ctx) {
		return nil
	}

	return standardRegistry
}
1175291
func MustRegister(registerer prometheus.Registerer) {
	if registerer == nil {
		registerer = prometheus.DefaultRegisterer
	}
	registerer.MustRegister(requestsReceived)
	registerer.MustRegister(responsesSent)
	registerer.MustRegister(rpcDurations)
}
160906
func (ms *MetricSystem) RegisterGaugeFunc(name string, f func() float64) {
	ms.gaugeFuncsMu.Lock()
	ms.gaugeFuncs[name] = f
	ms.gaugeFuncsMu.Unlock()
}
1050854
func (a *Api) Register(container *restful.Container) {
	ws := new(restful.WebService)
	ws.Path("/api/v1/metric-export").
		Doc("Exports the latest point for all Heapster metrics").
		Produces(restful.MIME_JSON)
	ws.Route(ws.GET("").
		To(a.exportMetrics).
		Doc("export the latest data point for all metrics").
		Operation("exportMetrics").
		Writes([]*types.Timeseries{}))
	container.Add(ws)
	ws = new(restful.WebService)
	ws.Path("/api/v1/metric-export-schema").
		Doc("Schema for metrics exported by heapster").
		Produces(restful.MIME_JSON)
	ws.Route(ws.GET("").
		To(a.exportMetricsSchema).
		Doc("export the schema for all metrics").
		Operation("exportmetricsSchema").
		Writes(types.TimeseriesSchema{}))
	container.Add(ws)

	if a.metricSink != nil {
		a.RegisterModel(container)
	}

	if a.historicalSource != nil {
		a.RegisterHistorical(container)
	}
}
971027
func Register() {
	registerMetrics.Do(func() {
		prometheus.MustRegister(CRIOOperations)
		prometheus.MustRegister(CRIOOperationsLatency)
		prometheus.MustRegister(CRIOOperationsErrors)
	})
}
1266978
func Register() {
	registerMetrics.Do(func() {
		prometheus.MustRegister(DockerOperationsLatency)
		prometheus.MustRegister(DockerOperations)
		prometheus.MustRegister(DockerOperationsErrors)
		prometheus.MustRegister(DockerOperationsTimeout)
		prometheus.MustRegister(DeprecatedDockerOperationsLatency)
		prometheus.MustRegister(DeprecatedDockerOperations)
		prometheus.MustRegister(DeprecatedDockerOperationsErrors)
		prometheus.MustRegister(DeprecatedDockerOperationsTimeout)
	})
}
306515
func (m *metricCollectorRegistry) Register(initMetricCollector func(string) MetricCollector) {
	m.lock.Lock()
	defer m.lock.Unlock()

	m.registry = append(m.registry, initMetricCollector)
}
750380
func NewWorkflowRegistry(informer cache.SharedIndexInformer) *prometheus.Registry {
	workflowLister := util.NewWorkflowLister(informer)
	registry := prometheus.NewRegistry()
	registry.MustRegister(&workflowCollector{store: workflowLister})
	return registry
}
830373
func RegisterAlgorithmProvider(name string, predicateKeys, priorityKeys sets.String) string {
	schedulerFactoryMutex.Lock()
	defer schedulerFactoryMutex.Unlock()
	validateAlgorithmNameOrDie(name)
	algorithmProviderMap[name] = AlgorithmProviderConfig{
		FitPredicateKeys:     predicateKeys,
		PriorityFunctionKeys: priorityKeys,
	}
	return name
}
487273
func NewPrometheusProvider(namespace, subsystem string) Provider {
	return &prometheusProvider{
		namespace: namespace,
		subsystem: subsystem,
	}
}
296450
func NewPromScope(registerer prometheus.Registerer, scopes ...string) Scope {
	return &promScope{
		prefix:         scopes,
		autoRegisterer: newAutoRegisterer(registerer),
		registerer:     registerer,
	}
}
427895
func (reg *Manager) RegisterProvider(ctx context.Context, wg *sync.WaitGroup, provider RegistrationDataProvider) error {
	wg.Add(1)
	go reg.registrationWorker(ctx, wg, provider)

	return nil
}
145388
func (m *Metrics) MustRegister(c prometheus.Collector) {
	err := m.Reg.Register(c)
	if err != nil {
		// ignore any duplicate error, but fatal on any other kind of error
		if _, ok := err.(prometheus.AlreadyRegisteredError); !ok {
			log.Fatalf("Cannot register metrics collector: %s", err)
		}
	}
}
463457
func (r *Registry) RegisterParameterParser(paramType string, parser ParameterParser) {
	r.parsersLock.Lock()
	defer r.parsersLock.Unlock()
	r.parsers[paramType] = parser
}
1194788
func RegisterVolumeSchedulingMetrics() {
	prometheus.MustRegister(VolumeBindingRequestSchedulerBinderCache)
	prometheus.MustRegister(VolumeSchedulingStageLatency)
	prometheus.MustRegister(VolumeSchedulingStageFailed)
}
932374
func RegisterPriorityFunction(name string, function priorities.PriorityFunction, weight int) string {
	return RegisterPriorityConfigFactory(name, PriorityConfigFactory{
		Function: func(PluginFactoryArgs) priorities.PriorityFunction {
			return function
		},
		Weight: weight,
	})
}
529648
func (wa *AggregatedRegistration) Register(resyncName, keyPrefix string) error {
	for _, registration := range wa.Registrations {
		if err := registration.Register(resyncName, keyPrefix); err != nil {
			logging.DefaultLogger.Warnf("aggregated register failed: %v", err)
		}
	}

	return nil
}