code: func (c *ReplicaCalculator) GetObjectPerPodMetricReplicas(currentReplicas int32, targetAverageUtilization int64, metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (replicaCount int32, utilization int64, timestamp time.Time, err error) {
  	utilization, timestamp, err = c.metricsClient.GetObjectMetric(metricName, namespace, objectRef, metricSelector)
  	if err != nil {
  		return 0, 0, time.Time{}, fmt.Errorf("unable to get metric %s: %v on %s %s/%s", metricName, objectRef.Kind, namespace, objectRef.Name, err)
  	}
  
  	usageRatio := float64(utilization) / (float64(targetAverageUtilization) * float64(replicaCount))
  	if math.Abs(1.0-usageRatio) > c.tolerance {
  		// update number of replicas if change is large enough
  		replicaCount = int32(math.Ceil(float64(utilization) / float64(targetAverageUtilization)))
  	}
  	utilization = int64(math.Ceil(float64(utilization) / float64(currentReplicas)))
  	return replicaCount, utilization, timestamp, nil
  }
docs: // GetObjectPerPodMetricReplicas calculates the desired replica count based on a target metric utilization (as a milli-value)
  // for the given object in the given namespace, and the current replica count.