Sdílet prostřednictvím


LoadTestRunClient.GetMetricDimensionValues Method

Definition

List the dimension values for the given metric dimension name.

public virtual Azure.Pageable<BinaryData> GetMetricDimensionValues (string testRunId, string name, string metricName, string metricNamespace, string timeInterval, string interval = default, Azure.RequestContext context = default);
abstract member GetMetricDimensionValues : string * string * string * string * string * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetMetricDimensionValues : string * string * string * string * string * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetMetricDimensionValues (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 Pageable(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 Pageable<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 GetMetricDimensionValues 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);

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

This sample shows how to call GetMetricDimensionValues 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);

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

Applies to