Udostępnij za pośrednictwem


LoadTestRunClient.GetMetricDimensionValuesAsync Method

Definition

List the dimension values for the given metric dimension name.

public virtual Azure.AsyncPageable<BinaryData> GetMetricDimensionValuesAsync (string testRunId, string name, string metricName, string metricNamespace, string timeInterval, string interval = default, Azure.RequestContext context = default);
abstract member GetMetricDimensionValuesAsync : string * string * string * string * string * string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetMetricDimensionValuesAsync : string * string * string * string * string * string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetMetricDimensionValuesAsync (testRunId As String, name As String, metricName As String, metricNamespace As String, timeInterval As String, Optional interval As String = Nothing, Optional context As RequestContext = Nothing) As AsyncPageable(Of BinaryData)

Parameters

testRunId
String

Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore or hyphen characters.

name
String

Dimension name.

metricName
String

Metric name.

metricNamespace
String

Metric namespace to query metric definitions for.

timeInterval
String

The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'.

interval
String

The interval (i.e. timegrain) of the query. Allowed values: "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H".

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The AsyncPageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.

Exceptions

testRunId, name, metricName, metricNamespace or timeInterval is null.

testRunId or name is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call GetMetricDimensionValuesAsync with required parameters and parse the result.

var credential = new DefaultAzureCredential();
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new LoadTestRunClient(endpoint, credential);

await foreach (var data in client.GetMetricDimensionValuesAsync("<testRunId>", "<name>", "<metricName>", "<metricNamespace>", "<timeInterval>"))
{
    JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
    Console.WriteLine(result.ToString());
}

This sample shows how to call GetMetricDimensionValuesAsync with all parameters, and how to parse the result.

var credential = new DefaultAzureCredential();
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new LoadTestRunClient(endpoint, credential);

await foreach (var data in client.GetMetricDimensionValuesAsync("<testRunId>", "<name>", "<metricName>", "<metricNamespace>", "<timeInterval>", "<interval>"))
{
    JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
    Console.WriteLine(result.ToString());
}

Applies to