agent/metrics/metrics_engine.go
func NewMetricsEngine(cfg *config.Config, registry *prometheus.Registry) *MetricsEngine {
	metricsEngine := &MetricsEngine{
		cfg:            cfg,
		Registry:       registry,
		managedMetrics: make(map[APIType]MetricsClient),
	}
	for managedAPI, _ := range managedAPIs {
		aClient := NewMetricsClient(managedAPI, metricsEngine.Registry)
		metricsEngine.managedMetrics[managedAPI] = aClient
	}
	return metricsEngine
}
func NewMetricsEngine(cfg *config.Config, registry *prometheus.Registry) *MetricsEngine {
	metricsEngine := &MetricsEngine{
		cfg:            cfg,
		Registry:       registry,
		managedMetrics: make(map[APIType]MetricsClient),
	}
	for managedAPI, _ := range managedAPIs {
		aClient := NewMetricsClient(managedAPI, metricsEngine.Registry)
		metricsEngine.managedMetrics[managedAPI] = aClient
	}
	return metricsEngine
}
func NewMetricsEngine ( cfg * config . Config , registry * prometheus . Registry ) * MetricsEngine { metricsEngine := & MetricsEngine { cfg : cfg , Registry : registry , managedMetrics : make ( map [ APIType ] MetricsClient ) , } for managedAPI , _ := range managedAPIs { aClient := NewMetricsClient ( managedAPI , metricsEngine . Registry ) metricsEngine . managedMetrics [ managedAPI ] = aClient } return metricsEngine }
// We create a MetricsClient for all managed APIs (APIs for which we will collect
// metrics)
We create a MetricsClient for all managed APIs ( APIs for which we will collect metrics )