func InspectWPA(wpa *v1alpha1.WatermarkPodAutoscaler) (emList []custommetrics.ExternalMetricValue) {
	for _, metricSpec := range wpa.Spec.Metrics {
		switch metricSpec.Type {
		case v1alpha1.ExternalMetricSourceType:
			if metricSpec.External == nil {
				log.Errorf("Missing required \"external\" section in the %s/%s WPA, skipping processing", wpa.Namespace, wpa.Name)
				continue
			}

			em := custommetrics.ExternalMetricValue{
				MetricName: metricSpec.External.MetricName,
				Ref: custommetrics.ObjectReference{
					Type:      "watermark",
					Name:      wpa.Name,
					Namespace: wpa.Namespace,
					UID:       string(wpa.UID),
				},
			}
			if metricSpec.External.MetricSelector != nil {
				em.Labels = metricSpec.External.MetricSelector.MatchLabels
			}
			emList = append(emList, em)
		default:
			log.Debugf("Unsupported metric type %s", metricSpec.Type)
		}
	}
	return
}
// InspectWPA returns the list of external metrics from the wpa to use for autoscaling.
InspectWPA returns the list of external metrics from the wpa to use for autoscaling.
// InspectWPA returns the list of external metrics from the wpa to use for autoscaling .
func InspectWPA(wpa *v1alpha1.WatermarkPodAutoscaler) (emList []custommetrics.ExternalMetricValue) {
	for _, metricSpec := range wpa.Spec.Metrics {
		switch metricSpec.Type {
		case v1alpha1.ExternalMetricSourceType:
			if metricSpec.External == nil {
				log.Errorf("Missing required \"external\" section in the %s/%s WPA, skipping processing", wpa.Namespace, wpa.Name)
				continue
			}
			em := custommetrics.ExternalMetricValue{
				MetricName: metricSpec.External.MetricName,
				Ref: custommetrics.ObjectReference{
					Type:      "watermark",
					Name:      wpa.Name,
					Namespace: wpa.Namespace,
					UID:       string(wpa.UID),
				},
			}
			if metricSpec.External.MetricSelector != nil {
				em.Labels = metricSpec.External.MetricSelector.MatchLabels
			}
			emList = append(emList, em)
		default:
			log.Debugf("Unsupported metric type %s", metricSpec.Type)
		}
	}
	return
}
func InspectWPA ( wpa * v1alpha1 . WatermarkPodAutoscaler ) ( emList [ ] custommetrics . ExternalMetricValue ) { for _ , metricSpec := range wpa . Spec . Metrics { switch metricSpec . Type { case v1alpha1 . ExternalMetricSourceType : if metricSpec . External == nil { log . Errorf ( " \" \" " , wpa . Namespace , wpa . Name ) continue } em := custommetrics . ExternalMetricValue { MetricName : metricSpec . External . MetricName , Ref : custommetrics . ObjectReference { Type : " " , Name : wpa . Name , Namespace : wpa . Namespace , UID : string ( wpa . UID ) , } , } if metricSpec . External . MetricSelector != nil { em . Labels = metricSpec . External . MetricSelector . MatchLabels } emList = append ( emList , em ) default : log . Debugf ( " " , metricSpec . Type ) } } return }
InspectWPA returns the list of external metrics from the wpa to use for autoscaling.
InspectWPA returns the list of external metrics from the wpa to use for autoscaling .