code: func (a *HorizontalController) computeStatusForPodsMetric(currentReplicas int32, metricSpec autoscalingv2.MetricSpec, hpa *autoscalingv2.HorizontalPodAutoscaler, selector labels.Selector, status *autoscalingv2.MetricStatus, metricSelector labels.Selector) (int32, time.Time, string, error) {
  	replicaCountProposal, utilizationProposal, timestampProposal, err := a.replicaCalc.GetMetricReplicas(currentReplicas, metricSpec.Pods.Target.AverageValue.MilliValue(), metricSpec.Pods.Metric.Name, hpa.Namespace, selector, metricSelector)
  	if err != nil {
  		a.eventRecorder.Event(hpa, v1.EventTypeWarning, "FailedGetPodsMetric", err.Error())
  		setCondition(hpa, autoscalingv2.ScalingActive, v1.ConditionFalse, "FailedGetPodsMetric", "the HPA was unable to compute the replica count: %v", err)
  		return 0, timestampProposal, "", err
  	}
  	*status = autoscalingv2.MetricStatus{
  		Type: autoscalingv2.PodsMetricSourceType,
  		Pods: &autoscalingv2.PodsMetricStatus{
  			Metric: autoscalingv2.MetricIdentifier{
  				Name:     metricSpec.Pods.Metric.Name,
  				Selector: metricSpec.Pods.Metric.Selector,
  			},
  			Current: autoscalingv2.MetricValueStatus{
  				AverageValue: resource.NewMilliQuantity(utilizationProposal, resource.DecimalSI),
  			},
  		},
  	}
  
  	return replicaCountProposal, timestampProposal, fmt.Sprintf("pods metric %s", metricSpec.Pods.Metric.Name), nil
  }
docs: // computeStatusForPodsMetric computes the desired number of replicas for the specified metric of type PodsMetricSourceType.