Creates a MetricsQueryClient.
A TokenCredential that has rights to query metrics on resources.
Options for the client like controlling request retries.
/**
Returns an async iterable iterator to list metric definitions.
Example using for await
syntax:
const metricsQueryClient = new MetricsQueryClient(tokenCredential);
const metricDefinitions = client.listMetricDefinitions(resourceUri, options);
let i = 1;
for await (const metricDefinition of metricDefinitions) {
console.log(`metricDefinition ${i++}:`);
console.log(metricDefinition);
}
Example using iter.next()
:
let iter = client.listMetricDefinitions(resourceUri, options);
let result = await iter.next();
while (!result.done) {
console.log(` metricDefinitions - ${result.value.id}, ${result.value.name}`);
result = await iter.next();
}
Get a list of metric definitions, given a resource URI.
The resource URI to get metric definitions for.
Options for getting metric definitions.
Metric definitions for a given resource URI.
Returns an async iterable iterator to list metric namespaces.
Example using for await
syntax:
const metricsQueryClient = new MetricsQueryClient(tokenCredential);
const metricNamespaces = client.listMetricNamespaces(resourceUri, options);
let i = 1;
for await (const metricNamespace of metricNamespaces) {
console.log(`metricNamespace ${i++}:`);
console.log(metricNamespace);
}
Example using iter.next()
:
let iter = client.listMetricNamespaces(resourceUri, options);
let result = await iter.next();
while (!result.done) {
console.log(` metricNamespace - ${result.value.id}, ${result.value.name}`);
result = await iter.next();
}
Get a list of metric namespaces, given a resource URI.
The resource URI to get metric namespaces for.
Options for getting metric namespaces.
Metric namespaces for a given resource URI.
Query metrics, given a resource URI
The resource URI to query.
The names of the metrics to retrieve.
Options for querying metrics.
A response containing metrics.
Generated using TypeDoc
A client that can query metrics, get metric definitions and get metric namespaces.