azure-docs-sdk-java/docs-ref-autogen/com.azure.monitor.query.Met...

115 строки
13 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.monitor.query.MetricsQueryAsyncClient"
fullName: "com.azure.monitor.query.MetricsQueryAsyncClient"
name: "MetricsQueryAsyncClient"
nameWithType: "MetricsQueryAsyncClient"
summary: "The asynchronous client for querying Azure Monitor metrics."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public final class **MetricsQueryAsyncClient**"
methods:
- uid: "com.azure.monitor.query.MetricsQueryAsyncClient.listMetricDefinitions(java.lang.String)"
fullName: "com.azure.monitor.query.MetricsQueryAsyncClient.listMetricDefinitions(String resourceUri)"
name: "listMetricDefinitions(String resourceUri)"
nameWithType: "MetricsQueryAsyncClient.listMetricDefinitions(String resourceUri)"
summary: "Lists all the metrics definitions created for the resource URI."
parameters:
- description: "The resource URI for which the metrics definitions are listed."
name: "resourceUri"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public PagedFlux<MetricDefinition> listMetricDefinitions(String resourceUri)"
desc: "Lists all the metrics definitions created for the resource URI."
returns:
description: "A <xref uid=\"com.azure.core.http.rest.PagedFlux\" data-throw-if-not-resolved=\"false\" data-raw-source=\"paged collection\"></xref> of metrics definitions."
type: "<xref href=\"com.azure.core.http.rest.PagedFlux?alt=com.azure.core.http.rest.PagedFlux&text=PagedFlux\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.monitor.query.models.MetricDefinition?alt=com.azure.monitor.query.models.MetricDefinition&text=MetricDefinition\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.monitor.query.MetricsQueryAsyncClient.listMetricDefinitions(java.lang.String,java.lang.String)"
fullName: "com.azure.monitor.query.MetricsQueryAsyncClient.listMetricDefinitions(String resourceUri, String metricsNamespace)"
name: "listMetricDefinitions(String resourceUri, String metricsNamespace)"
nameWithType: "MetricsQueryAsyncClient.listMetricDefinitions(String resourceUri, String metricsNamespace)"
summary: "Lists all the metrics definitions created for the resource URI."
parameters:
- description: "The resource URI for which the metrics definitions are listed."
name: "resourceUri"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The metrics namespace to which the listed metrics definitions belong."
name: "metricsNamespace"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public PagedFlux<MetricDefinition> listMetricDefinitions(String resourceUri, String metricsNamespace)"
desc: "Lists all the metrics definitions created for the resource URI."
returns:
description: "A <xref uid=\"com.azure.core.http.rest.PagedFlux\" data-throw-if-not-resolved=\"false\" data-raw-source=\"paged collection\"></xref> of metrics definitions."
type: "<xref href=\"com.azure.core.http.rest.PagedFlux?alt=com.azure.core.http.rest.PagedFlux&text=PagedFlux\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.monitor.query.models.MetricDefinition?alt=com.azure.monitor.query.models.MetricDefinition&text=MetricDefinition\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.monitor.query.MetricsQueryAsyncClient.listMetricNamespaces(java.lang.String,java.time.OffsetDateTime)"
fullName: "com.azure.monitor.query.MetricsQueryAsyncClient.listMetricNamespaces(String resourceUri, OffsetDateTime startTime)"
name: "listMetricNamespaces(String resourceUri, OffsetDateTime startTime)"
nameWithType: "MetricsQueryAsyncClient.listMetricNamespaces(String resourceUri, OffsetDateTime startTime)"
summary: "Lists all the metrics namespaces created for the resource URI."
parameters:
- description: "The resource URI for which the metrics namespaces are listed."
name: "resourceUri"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The returned list of metrics namespaces are created after the specified start time."
name: "startTime"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html\">OffsetDateTime</a>"
syntax: "public PagedFlux<MetricNamespace> listMetricNamespaces(String resourceUri, OffsetDateTime startTime)"
desc: "Lists all the metrics namespaces created for the resource URI."
returns:
description: "A <xref uid=\"com.azure.core.http.rest.PagedFlux\" data-throw-if-not-resolved=\"false\" data-raw-source=\"paged collection\"></xref> of metrics namespaces."
type: "<xref href=\"com.azure.core.http.rest.PagedFlux?alt=com.azure.core.http.rest.PagedFlux&text=PagedFlux\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.monitor.query.models.MetricNamespace?alt=com.azure.monitor.query.models.MetricNamespace&text=MetricNamespace\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.monitor.query.MetricsQueryAsyncClient.queryResource(java.lang.String,java.util.List<java.lang.String>)"
fullName: "com.azure.monitor.query.MetricsQueryAsyncClient.queryResource(String resourceUri, List<String> metricsNames)"
name: "queryResource(String resourceUri, List<String> metricsNames)"
nameWithType: "MetricsQueryAsyncClient.queryResource(String resourceUri, List<String> metricsNames)"
summary: "Returns all the Azure Monitor metrics requested for the resource."
parameters:
- description: "The resource URI for which the metrics is requested."
name: "resourceUri"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The names of the metrics to query."
name: "metricsNames"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
syntax: "public Mono<MetricsQueryResult> queryResource(String resourceUri, List<String> metricsNames)"
desc: "Returns all the Azure Monitor metrics requested for the resource.\n\n**Query metrics for an Azure resource**\n\n```java\nMono<MetricsQueryResult> response = metricsQueryAsyncClient\n .queryResource(\"{resource-id}\", Arrays.asList(\"{metric-1}\", \"{metric-2}\"));\n\n response.subscribe(result -> {\n for (MetricResult metricResult : result.getMetrics()) {\n System.out.println(\"Metric name \" + metricResult.getMetricName());\n metricResult.getTimeSeries().stream()\n .flatMap(timeSeriesElement -> timeSeriesElement.getValues().stream())\n .forEach(metricValue ->\n System.out.println(\"Time stamp: \" + metricValue.getTimeStamp() + \"; Total: \"\n + metricValue.getTotal()));\n }\n });\n```"
returns:
description: "A time-series metrics result for the requested metric names."
type: "<a href=\"https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html\">Mono</a>&lt;<xref href=\"com.azure.monitor.query.models.MetricsQueryResult?alt=com.azure.monitor.query.models.MetricsQueryResult&text=MetricsQueryResult\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.monitor.query.MetricsQueryAsyncClient.queryResourceWithResponse(java.lang.String,java.util.List<java.lang.String>,com.azure.monitor.query.models.MetricsQueryOptions)"
fullName: "com.azure.monitor.query.MetricsQueryAsyncClient.queryResourceWithResponse(String resourceUri, List<String> metricsNames, MetricsQueryOptions options)"
name: "queryResourceWithResponse(String resourceUri, List<String> metricsNames, MetricsQueryOptions options)"
nameWithType: "MetricsQueryAsyncClient.queryResourceWithResponse(String resourceUri, List<String> metricsNames, MetricsQueryOptions options)"
summary: "Returns all the Azure Monitor metrics requested for the resource."
parameters:
- description: "The resource URI for which the metrics is requested."
name: "resourceUri"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The names of the metrics to query."
name: "metricsNames"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "Options to filter the query."
name: "options"
type: "<xref href=\"com.azure.monitor.query.models.MetricsQueryOptions?alt=com.azure.monitor.query.models.MetricsQueryOptions&text=MetricsQueryOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Mono<Response<MetricsQueryResult>> queryResourceWithResponse(String resourceUri, List<String> metricsNames, MetricsQueryOptions options)"
desc: "Returns all the Azure Monitor metrics requested for the resource."
returns:
description: "A time-series metrics result for the requested metric names."
type: "<a href=\"https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html\">Mono</a>&lt;<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.monitor.query.models.MetricsQueryResult?alt=com.azure.monitor.query.models.MetricsQueryResult&text=MetricsQueryResult\" data-throw-if-not-resolved=\"False\" />&gt;&gt;"
type: "class"
desc: "The asynchronous client for querying Azure Monitor metrics.\n\nAzure Monitor Metrics is a feature of Azure Monitor that collects numeric data from monitored resources into a time-series database. Metrics are numerical values that are collected at regular intervals and describe some aspect of a system at a particular time. The MetricsQueryClient provides synchronous implementations of methods that query metrics from your Azure services.\n\n## Getting Started ##\n\nAuthenticating and building MetricsQueryAsyncClient instances are done through <xref uid=\"com.azure.monitor.query.MetricsQueryClientBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"MetricsQueryClientBuilder\"></xref>. The following sample shows how to build a new MetricsQueryClient instance.\n\n```java\nMetricsQueryAsyncClient metricsQueryAsyncClient = new MetricsQueryClientBuilder()\n .credential(tokenCredential)\n .buildAsyncClient();\n```\n\nFor more information on building and authenticating, see the <xref uid=\"com.azure.monitor.query.MetricsQueryClientBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"MetricsQueryClientBuilder\"></xref> documentation.\n\n### Client Usage ###\n\nFor more information on using the MetricsQueryAsyncClient, see the following method documentation:\n\n * <xref uid=\"com.azure.monitor.query.MetricsQueryAsyncClient.queryResource(java.lang.String,java.util.List<java.lang.String>)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"MetricsQueryAsyncClient#queryResource(String, List)\"></xref> \\- Query metrics for an Azure resource. <xref uid=\"com.azure.monitor.query.MetricsQueryAsyncClient.listMetricNamespaces(java.lang.String,java.time.OffsetDateTime)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"MetricsQueryAsyncClient#listMetricNamespaces(String, OffsetDateTime)\"></xref> \\- Lists all the metrics namespaces created for the resource URI. <xref uid=\"com.azure.monitor.query.MetricsQueryAsyncClient.listMetricDefinitions(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"MetricsQueryAsyncClient#listMetricDefinitions(String)\"></xref> \\- Lists all the metrics definitions created for the resource URI."
metadata: {}
package: "com.azure.monitor.query"
artifact: com.azure:azure-monitor-query:1.5.1