code: public PagedList<ResourceMetricInner> listMetrics(final String resourceGroupName, final String name, final Boolean details, final String filter) {
          ServiceResponse<Page<ResourceMetricInner>> response = listMetricsSinglePageAsync(resourceGroupName, name, details, filter).toBlocking().single();
          return new PagedList<ResourceMetricInner>(response.body()) {
              @Override
              public Page<ResourceMetricInner> nextPage(String nextPageLink) {
                  return listMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().body();
              }
          };
      }
docs: Get metrics for an App Serice plan.
  Get metrics for an App Serice plan.
  
  @param resourceGroupName Name of the resource group to which the resource belongs.
  @param name Name of the App Service plan.
  @param details Specify &lt;code&gt;true&lt;/code&gt; to include instance details. The default is &lt;code&gt;false&lt;/code&gt;.
  @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'.
  @throws IllegalArgumentException thrown if parameters fail the validation
  @throws CloudException thrown if the request is rejected by server
  @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
  @return the PagedList&lt;ResourceMetricInner&gt; object if successful.