class MetricOperationsImpl<T, L> extends OperationSupport implements MetricOperation<T, L> {
  public static final String METRIC_ENDPOINT_URL = "apis/metrics.k8s.io/v1beta1/";
  private final Class<L> apiTypeListClass;
  private final Class<T> apiTypeClass;

  public MetricOperationsImpl(OperationContext operationContext, Class<T> apiTypeClass, Class<L> apiTypeListClass) {
    super(operationContext);
    this.apiTypeClass = apiTypeClass;
    this.apiTypeListClass = apiTypeListClass;
  }

  /**
   * Get a list of metrics
   *
   * @return a list object for metrics
   */
  @Override
  public L metrics() {<FILL_FUNCTION_BODY>}

  /**
   * Get a single metric. name needs to be provided.
   *
   * @return a single metric
   */
  @Override
  public T metric() {
    try {
      return handleMetric(getMetricEndpointUrl(), apiTypeClass);
    } catch (IOException exception) {
      throw KubernetesClientException.launderThrowable(exception);
    } catch (InterruptedException interruptedException) {
      Thread.currentThread().interrupt();
      throw KubernetesClientException.launderThrowable(interruptedException);
    }
  }

  /**
   * Returns a list of metrics matching specified labels
   *
   * @param labelsMap labels as HashMap
   * @return list of metrics found matching provided label
   */
  @Override
  public L metrics(Map<String, Object> labelsMap) {
    Map<String, String> labels = new HashMap<>();
    labelsMap.forEach((k, v) -> labels.put(k, v.toString()));

    return withLabels(labels).metrics();
  }

  protected String getMetricEndpointUrlWithPlural(String plural) {
    String result = URLUtils.join(config.getMasterUrl(), METRIC_ENDPOINT_URL);
    if (isResourceNamespaced() && namespace != null) {
      result += "namespaces/" + namespace + "/";
    }
    result += plural;
    if (context.getName() != null) {
      result += "/" + context.getName();
    }
    if (Utils.isNotNullOrEmpty(context.getLabels())) {
      result = getUrlWithLabels(result, context.getLabels());
    }
    return result;
  }

  private String getMetricEndpointUrl() {
    return getMetricEndpointUrlWithPlural(context.getPlural());
  }

  private String getUrlWithLabels(String baseUrl, Map<String, String> labels) {
    URLBuilder httpUrlBuilder = new URLBuilder(baseUrl);

    StringBuilder sb = new StringBuilder();
    for (Map.Entry<String, String> entry : labels.entrySet()) {
      sb.append(entry.getKey()).append("=").append(entry.getValue()).append(",");
    }
    httpUrlBuilder.addQueryParameter("labelSelector", sb.substring(0, sb.toString().length() - 1));
    return httpUrlBuilder.toString();
  }

}

    try {
      return handleMetric(getMetricEndpointUrl(), apiTypeListClass);
    } catch (IOException exception) {
      throw KubernetesClientException.launderThrowable(exception);
    } catch (InterruptedException interruptedException) {
      Thread.currentThread().interrupt();
      throw KubernetesClientException.launderThrowable(interruptedException);
    }
  
<methods>public void <init>(io.fabric8.kubernetes.client.Client) ,public void <init>(io.fabric8.kubernetes.client.dsl.internal.OperationContext) ,public static Status createStatus(HttpResponse<?>, io.fabric8.kubernetes.client.utils.KubernetesSerialization) ,public static Status createStatus(int, java.lang.String) ,public java.lang.String getAPIGroupName() ,public java.lang.String getAPIGroupVersion() ,public io.fabric8.kubernetes.client.Config getConfig() ,public io.fabric8.kubernetes.client.utils.KubernetesSerialization getKubernetesSerialization() ,public java.lang.String getName() ,public java.lang.String getNamespace() ,public java.net.URL getNamespacedUrl(java.lang.String) throws java.net.MalformedURLException,public java.net.URL getNamespacedUrl() throws java.net.MalformedURLException,public io.fabric8.kubernetes.client.dsl.internal.OperationContext getOperationContext() ,public io.fabric8.kubernetes.client.RequestConfig getRequestConfig() ,public java.lang.String getResourceT() ,public java.net.URL getResourceURLForPatchOperation(java.net.URL, io.fabric8.kubernetes.client.dsl.base.PatchContext) throws java.net.MalformedURLException,public java.net.URL getResourceURLForWriteOperation(java.net.URL) throws java.net.MalformedURLException,public transient java.net.URL getResourceUrl(java.lang.String, java.lang.String, java.lang.String[]) throws java.net.MalformedURLException,public java.net.URL getResourceUrl(java.lang.String, java.lang.String) throws java.net.MalformedURLException,public java.net.URL getResourceUrl() throws java.net.MalformedURLException,public R1 handleRaw(Class<R1>, java.lang.String, java.lang.String, java.lang.Object) ,public boolean isResourceNamespaced() ,public static io.fabric8.kubernetes.client.KubernetesClientException requestException(io.fabric8.kubernetes.client.http.HttpRequest, java.lang.Throwable, java.lang.String) ,public static io.fabric8.kubernetes.client.KubernetesClientException requestException(io.fabric8.kubernetes.client.http.HttpRequest, java.lang.Exception) ,public static io.fabric8.kubernetes.client.KubernetesClientException requestFailure(io.fabric8.kubernetes.client.http.HttpRequest, Status) ,public static io.fabric8.kubernetes.client.KubernetesClientException requestFailure(io.fabric8.kubernetes.client.http.HttpRequest, Status, java.lang.String) ,public transient R1 restCall(Class<R1>, java.lang.String[]) <variables>private static final java.lang.String CLIENT_STATUS_FLAG,private static final java.lang.String FIELD_MANAGER_PARAM,public static final java.lang.String JSON,public static final java.lang.String JSON_MERGE_PATCH,public static final java.lang.String JSON_PATCH,private static final Logger LOG,public static final java.lang.String STRATEGIC_MERGE_JSON_PATCH,protected java.lang.String apiGroupName,protected java.lang.String apiGroupVersion,protected final non-sealed io.fabric8.kubernetes.client.Config config,protected io.fabric8.kubernetes.client.dsl.internal.OperationContext context,protected boolean dryRun,protected final non-sealed io.fabric8.kubernetes.client.http.HttpClient httpClient,protected java.lang.String name,protected java.lang.String namespace,protected final non-sealed java.lang.String resourceT,protected java.lang.String subresource