code: func (c *customMetricsClient) GetObjectMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) {
  	gvk := schema.FromAPIVersionAndKind(objectRef.APIVersion, objectRef.Kind)
  	var metricValue *customapi.MetricValue
  	var err error
  	if gvk.Kind == "Namespace" && gvk.Group == "" {
  		// handle namespace separately
  		// NB: we ignore namespace name here, since CrossVersionObjectReference isn't
  		// supposed to allow you to escape your namespace
  		metricValue, err = c.client.RootScopedMetrics().GetForObject(gvk.GroupKind(), namespace, metricName, metricSelector)
  	} else {
  		metricValue, err = c.client.NamespacedMetrics(namespace).GetForObject(gvk.GroupKind(), objectRef.Name, metricName, metricSelector)
  	}
  
  	if err != nil {
  		return 0, time.Time{}, fmt.Errorf("unable to fetch metrics from custom metrics API: %v", err)
  	}
  
  	return metricValue.Value.MilliValue(), metricValue.Timestamp.Time, nil
  }
docs: // GetObjectMetric gets the given metric (and an associated timestamp) for the given
  // object in the given namespace