public final class MetricsAdvisorClient extends Object
Instantiating an synchronous DataFeedMetric Advisor Client
MetricsAdvisorClient
metricsAdvisorClient = newMetricsAdvisorClientBuilder
() .credential(newMetricsAdvisorKeyCredential
("{subscription_key}", "{api_key}")) .endpoint("{endpoint}") .buildClient();
MetricsAdvisorClientBuilder
Modifier and Type | Method and Description |
---|---|
MetricFeedback |
addFeedback(String metricId,
MetricFeedback metricFeedback)
Create a new metric feedback.
|
com.azure.core.http.rest.Response<MetricFeedback> |
addFeedbackWithResponse(String metricId,
MetricFeedback metricFeedback,
com.azure.core.util.Context context)
Create a new metric feedback.
|
MetricFeedback |
getFeedback(String feedbackId)
Get a metric feedback by its id.
|
com.azure.core.http.rest.Response<MetricFeedback> |
getFeedbackWithResponse(String feedbackId,
com.azure.core.util.Context context)
Get a metric feedback by its id.
|
com.azure.core.http.rest.PagedIterable<AnomalyAlert> |
listAlerts(String alertConfigurationId,
OffsetDateTime startTime,
OffsetDateTime endTime)
Fetch the alerts triggered by an anomaly alert configuration.
|
com.azure.core.http.rest.PagedIterable<AnomalyAlert> |
listAlerts(String alertConfigurationId,
OffsetDateTime startTime,
OffsetDateTime endTime,
ListAlertOptions options,
com.azure.core.util.Context context)
Fetch the alerts triggered by an anomaly alert configuration.
|
com.azure.core.http.rest.PagedIterable<DataPointAnomaly> |
listAnomaliesForAlert(String alertConfigurationId,
String alertId)
Fetch the anomalies in an alert.
|
com.azure.core.http.rest.PagedIterable<DataPointAnomaly> |
listAnomaliesForAlert(String alertConfigurationId,
String alertId,
ListAnomaliesAlertedOptions options,
com.azure.core.util.Context context)
Fetch the anomalies in an alert.
|
com.azure.core.http.rest.PagedIterable<DataPointAnomaly> |
listAnomaliesForDetectionConfig(String detectionConfigurationId,
OffsetDateTime startTime,
OffsetDateTime endTime)
Fetch the anomalies identified by an anomaly detection configuration.
|
com.azure.core.http.rest.PagedIterable<DataPointAnomaly> |
listAnomaliesForDetectionConfig(String detectionConfigurationId,
OffsetDateTime startTime,
OffsetDateTime endTime,
ListAnomaliesDetectedOptions options,
com.azure.core.util.Context context)
Fetch the anomalies identified by an anomaly detection configuration.
|
com.azure.core.http.rest.PagedIterable<String> |
listAnomalyDimensionValues(String detectionConfigurationId,
String dimensionName,
OffsetDateTime startTime,
OffsetDateTime endTime)
Fetch dimension values that have anomalies.
|
com.azure.core.http.rest.PagedIterable<String> |
listAnomalyDimensionValues(String detectionConfigurationId,
String dimensionName,
OffsetDateTime startTime,
OffsetDateTime endTime,
ListAnomalyDimensionValuesOptions options,
com.azure.core.util.Context context)
Fetch dimension values that have anomalies.
|
com.azure.core.http.rest.PagedIterable<MetricFeedback> |
listFeedback(String metricId)
List information of all metric feedbacks on the metrics advisor account.
|
com.azure.core.http.rest.PagedIterable<MetricFeedback> |
listFeedback(String metricId,
ListMetricFeedbackOptions options,
com.azure.core.util.Context context)
List information of all metric feedbacks on the metrics advisor account.
|
com.azure.core.http.rest.PagedIterable<IncidentRootCause> |
listIncidentRootCauses(AnomalyIncident anomalyIncident)
List the root causes for an anomalyIncident.
|
com.azure.core.http.rest.PagedIterable<IncidentRootCause> |
listIncidentRootCauses(String detectionConfigurationId,
String incidentId)
List the root causes for an incident.
|
com.azure.core.http.rest.PagedIterable<IncidentRootCause> |
listIncidentRootCauses(String detectionConfigurationId,
String incidentId,
com.azure.core.util.Context context)
List the root causes for an incident.
|
com.azure.core.http.rest.PagedIterable<AnomalyIncident> |
listIncidentsForAlert(String alertConfigurationId,
String alertId)
Fetch the incidents in an alert.
|
com.azure.core.http.rest.PagedIterable<AnomalyIncident> |
listIncidentsForAlert(String alertConfigurationId,
String alertId,
ListIncidentsAlertedOptions options,
com.azure.core.util.Context context)
Fetch the incidents in an alert.
|
com.azure.core.http.rest.PagedIterable<AnomalyIncident> |
listIncidentsForDetectionConfig(String detectionConfigurationId,
OffsetDateTime startTime,
OffsetDateTime endTime)
Fetch the incidents identified by an anomaly detection configuration.
|
com.azure.core.http.rest.PagedIterable<AnomalyIncident> |
listIncidentsForDetectionConfig(String detectionConfigurationId,
OffsetDateTime startTime,
OffsetDateTime endTime,
ListIncidentsDetectedOptions options,
com.azure.core.util.Context context)
Fetch the incidents identified by an anomaly detection configuration.
|
com.azure.core.http.rest.PagedIterable<String> |
listMetricDimensionValues(String metricId,
String dimensionName)
List dimension values from certain metric.
|
com.azure.core.http.rest.PagedIterable<String> |
listMetricDimensionValues(String metricId,
String dimensionName,
ListMetricDimensionValuesOptions options,
com.azure.core.util.Context context)
List dimension values from certain metric.
|
com.azure.core.http.rest.PagedIterable<MetricEnrichedSeriesData> |
listMetricEnrichedSeriesData(String detectionConfigurationId,
List<DimensionKey> seriesKeys,
OffsetDateTime startTime,
OffsetDateTime endTime)
Given a list of time series keys, retrieve time series version enriched using
a detection configuration.
|
com.azure.core.http.rest.PagedIterable<MetricEnrichedSeriesData> |
listMetricEnrichedSeriesData(String detectionConfigurationId,
List<DimensionKey> seriesKeys,
OffsetDateTime startTime,
OffsetDateTime endTime,
com.azure.core.util.Context context)
Given a list of time series keys, retrieve time series version enriched using
a detection configuration.
|
com.azure.core.http.rest.PagedIterable<EnrichmentStatus> |
listMetricEnrichmentStatus(String metricId,
OffsetDateTime startTime,
OffsetDateTime endTime)
List the enrichment status for a metric.
|
com.azure.core.http.rest.PagedIterable<EnrichmentStatus> |
listMetricEnrichmentStatus(String metricId,
OffsetDateTime startTime,
OffsetDateTime endTime,
ListMetricEnrichmentStatusOptions options,
com.azure.core.util.Context context)
List the enrichment status for a metric.
|
com.azure.core.http.rest.PagedIterable<MetricSeriesData> |
listMetricSeriesData(String metricId,
List<DimensionKey> seriesKeys,
OffsetDateTime startTime,
OffsetDateTime endTime)
Get time series data from metric.
|
com.azure.core.http.rest.PagedIterable<MetricSeriesData> |
listMetricSeriesData(String metricId,
List<DimensionKey> seriesKeys,
OffsetDateTime startTime,
OffsetDateTime endTime,
com.azure.core.util.Context context)
Get time series data from metric.
|
com.azure.core.http.rest.PagedIterable<MetricSeriesDefinition> |
listMetricSeriesDefinitions(String metricId,
OffsetDateTime activeSince)
List series (dimension combinations) from metric.
|
com.azure.core.http.rest.PagedIterable<MetricSeriesDefinition> |
listMetricSeriesDefinitions(String metricId,
OffsetDateTime activeSince,
ListMetricSeriesDefinitionOptions options,
com.azure.core.util.Context context)
List series (dimension combinations) from metric.
|
public com.azure.core.http.rest.PagedIterable<MetricSeriesDefinition> listMetricSeriesDefinitions(String metricId, OffsetDateTime activeSince)
Code sample
finalOffsetDateTime
activeSince =OffsetDateTime
.parse("2020-07-10T00:00:00Z"); metricsAdvisorClient.listMetricSeriesDefinitions( "metricId", activeSince) .forEach(metricSeriesDefinition -> {System
.out.printf("Data Feed Metric id for the retrieved series definition : %s%n", metricSeriesDefinition.getMetricId());System
.out.printf("Data Feed Metric dimension: %s%n", metricSeriesDefinition.getSeriesKey().asMap()); });
metricId
- metric unique id.activeSince
- the start time for querying series ingested after this time.PagedIterable
of the metric series definitions
.IllegalArgumentException
- thrown if metricId
fail the UUID format validation.MetricsAdvisorResponseException
- thrown if the request is rejected by server.NullPointerException
- thrown if the metricId
or activeSince
is null.public com.azure.core.http.rest.PagedIterable<MetricSeriesDefinition> listMetricSeriesDefinitions(String metricId, OffsetDateTime activeSince, ListMetricSeriesDefinitionOptions options, com.azure.core.util.Context context)
Code sample
String
metricId = "b460abfc-7a58-47d7-9d99-21ee21fdfc6e"; finalOffsetDateTime
activeSince =OffsetDateTime
.parse("2020-07-10T00:00:00Z"); finalListMetricSeriesDefinitionOptions
options = newListMetricSeriesDefinitionOptions
() .setMaxPageSize(10) .setDimensionCombinationToFilter(newHashMap
<String
,List
<String
>>() {{ put("Dim2",Collections
.singletonList("Angelfish")); }}); metricsAdvisorClient.listMetricSeriesDefinitions(metricId, activeSince, options,Context
.NONE) .forEach(metricSeriesDefinition -> {System
.out.printf("Data Feed Metric id for the retrieved series definition : %s%n", metricSeriesDefinition.getMetricId());System
.out.printf("Series Key:");System
.out.println(metricSeriesDefinition.getSeriesKey().asMap()); });
metricId
- metric unique id.activeSince
- the start time for querying series ingested after this time.options
- the additional filtering attributes that can be provided to query the series.context
- Additional context that is passed through the HTTP pipeline during the service call.PagedIterable
of the metric series definitions
.IllegalArgumentException
- thrown if metricId
fail the UUID format validation.MetricsAdvisorResponseException
- thrown if the request is rejected by server.NullPointerException
- thrown if the metricId
or activeSince
is null.public com.azure.core.http.rest.PagedIterable<MetricSeriesData> listMetricSeriesData(String metricId, List<DimensionKey> seriesKeys, OffsetDateTime startTime, OffsetDateTime endTime)
Code sample
finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T12:00:00Z"); metricsAdvisorClient.listMetricSeriesData("metricId",Arrays
.asList(newDimensionKey
(newHashMap
<String
,String
>() {{ put("Dim1", "value1"); }})), startTime, endTime) .forEach(metricSeriesData -> {System
.out.println("List of data points for this series:");System
.out.println(metricSeriesData.getMetricValues());System
.out.println("Timestamps of the data related to this time series:");System
.out.println(metricSeriesData.getTimestamps());System
.out.printf("Series Key:");System
.out.println(metricSeriesData.getSeriesKey().asMap()); });
metricId
- metric unique id.seriesKeys
- the series key to filter.
This enables additional filtering of dimension values being queried. For example, let's say we've the dimensions 'category' and 'city', so the api can query value of the dimension 'category', with series key as 'city=redmond'.
startTime
- The start time for querying the time series data.endTime
- The end time for querying the time series data.PagedIterable
of the metric series data points
.IllegalArgumentException
- thrown if metricId
fail the UUID format validation.NullPointerException
- thrown if the metricId
, startTime
or endTime
is null.public com.azure.core.http.rest.PagedIterable<MetricSeriesData> listMetricSeriesData(String metricId, List<DimensionKey> seriesKeys, OffsetDateTime startTime, OffsetDateTime endTime, com.azure.core.util.Context context)
Code sample
finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T12:00:00Z"); metricsAdvisorClient.listMetricSeriesData("metricId",Arrays
.asList(newDimensionKey
(newHashMap
<String
,String
>() {{ put("Dim1", "value1"); }})), startTime, endTime) .forEach(metricSeriesData -> {System
.out.printf("Data feed Id: %s%n", metricSeriesData.getMetricId());System
.out.printf("Data feed description: %s%n", metricSeriesData.getSeriesKey());System
.out.printf("Data feed source type: %.2f%n", metricSeriesData.getTimestamps());System
.out.printf("Data feed creator: %.2f%n", metricSeriesData.getMetricValues()); });
metricId
- metric unique id.seriesKeys
- the series key to filter.
This enables additional filtering of dimension values being queried. For example, let's say we've the dimensions 'category' and 'city', so the api can query value of the dimension 'category', with series key as 'city=redmond'.
startTime
- The start time for querying the time series data.endTime
- The end time for querying the time series data.context
- Additional context that is passed through the Http pipeline during the service call.PagedIterable
of the metric series data points
.IllegalArgumentException
- thrown if metricId
fail the UUID format validation.NullPointerException
- thrown if the metricId
, startTime
or endTime
is null.public com.azure.core.http.rest.PagedIterable<EnrichmentStatus> listMetricEnrichmentStatus(String metricId, OffsetDateTime startTime, OffsetDateTime endTime)
Code sample
finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-01-01T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); finalString
metricId = "d3gh4i4-b804-4ab9-a70f-0da0c89cft3l"; metricsAdvisorClient.listMetricEnrichmentStatus(metricId, startTime, endTime) .forEach(enrichmentStatus -> {System
.out.printf("Data Feed Metric enrichment status : %s%n", enrichmentStatus.getStatus());System
.out.printf("Data Feed Metric enrichment status message: %s%n", enrichmentStatus.getMessage());System
.out.printf("Data Feed Metric enrichment status data slice timestamp : %s%n", enrichmentStatus.getTimestamp()); });
metricId
- metric unique id.startTime
- The start time for querying the time series data.endTime
- The end time for querying the time series data.IllegalArgumentException
- thrown if metricId
fail the UUID format validation.MetricsAdvisorResponseException
- thrown if the request is rejected by server.NullPointerException
- thrown if metricId
, startTime
and endTime
is null.public com.azure.core.http.rest.PagedIterable<EnrichmentStatus> listMetricEnrichmentStatus(String metricId, OffsetDateTime startTime, OffsetDateTime endTime, ListMetricEnrichmentStatusOptions options, com.azure.core.util.Context context)
Code sample
finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-01-01T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); finalString
metricId = "d3gh4i4-b804-4ab9-a70f-0da0c89cft3l"; finalListMetricEnrichmentStatusOptions
options = newListMetricEnrichmentStatusOptions
().setMaxPageSize(10); metricsAdvisorClient.listMetricEnrichmentStatus(metricId, startTime, endTime, options,Context
.NONE) .forEach(enrichmentStatus -> {System
.out.printf("Data Feed Metric enrichment status : %s%n", enrichmentStatus.getStatus());System
.out.printf("Data Feed Metric enrichment status message: %s%n", enrichmentStatus.getMessage());System
.out.printf("Data Feed Metric enrichment status data slice timestamp : %s%n", enrichmentStatus.getTimestamp()); });
metricId
- metric unique id.startTime
- The start time for querying the time series data.endTime
- The end time for querying the time series data.options
- the additional configurable options to specify when querying the result.context
- Additional context that is passed through the Http pipeline during the service call.IllegalArgumentException
- thrown if metricId
fail the UUID format validation.MetricsAdvisorResponseException
- thrown if the request is rejected by server.NullPointerException
- thrown if metricId
, startTime
and endTime
is null.public com.azure.core.http.rest.PagedIterable<MetricEnrichedSeriesData> listMetricEnrichedSeriesData(String detectionConfigurationId, List<DimensionKey> seriesKeys, OffsetDateTime startTime, OffsetDateTime endTime)
Code sample
finalString
detectionConfigurationId = "e87d899d-a5a0-4259-b752-11aea34d5e34"; finalDimensionKey
seriesKey = newDimensionKey
() .put("Dim1", "Common Lime") .put("Dim2", "Antelope"); finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-08-12T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-12T00:00:00Z");PagedIterable
<MetricEnrichedSeriesData
> enrichedDataIterable = metricsAdvisorClient.listMetricEnrichedSeriesData(detectionConfigurationId,Arrays
.asList(seriesKey), startTime, endTime); for (MetricEnrichedSeriesData
enrichedData : enrichedDataIterable) {System
.out.printf("Series Key %s%n:", enrichedData.getSeriesKey().asMap());System
.out.println("List of data points for this series");System
.out.println(enrichedData.getMetricValues());System
.out.println("Timestamps of the data related to this time series:");System
.out.println(enrichedData.getTimestamps());System
.out.println("The expected values of the data points calculated by the smart detector:");System
.out.println(enrichedData.getExpectedMetricValues());System
.out.println("The lower boundary values of the data points calculated by smart detector:");System
.out.println(enrichedData.getLowerBoundaryValues());System
.out.println("the periods calculated for the data points in the time series:");System
.out.println(enrichedData.getPeriods()); }
detectionConfigurationId
- The id of the configuration used to enrich the time series
identified by the keys in seriesKeys
.seriesKeys
- The time series key list, each key identifies a specific time series.startTime
- The start time.endTime
- The end time.IllegalArgumentException
- thrown if detectionConfigurationId
fail the UUID format validation
or if seriesKeys
is empty.NullPointerException
- thrown if the detectionConfigurationId
or startTime
or endTime
is null.public com.azure.core.http.rest.PagedIterable<MetricEnrichedSeriesData> listMetricEnrichedSeriesData(String detectionConfigurationId, List<DimensionKey> seriesKeys, OffsetDateTime startTime, OffsetDateTime endTime, com.azure.core.util.Context context)
Code sample
finalString
detectionConfigurationId = "e87d899d-a5a0-4259-b752-11aea34d5e34"; finalDimensionKey
seriesKey = newDimensionKey
() .put("Dim1", "Common Lime") .put("Dim2", "Antelope"); finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-08-12T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-12T00:00:00Z");PagedIterable
<MetricEnrichedSeriesData
> enrichedDataIterable = metricsAdvisorClient.listMetricEnrichedSeriesData(detectionConfigurationId,Arrays
.asList(seriesKey), startTime, endTime);Stream
<PagedResponse
<MetricEnrichedSeriesData
>> enrichedDataPageStream = enrichedDataIterable.streamByPage(); int[] pageCount = new int[1]; enrichedDataPageStream.forEach(enrichedDataPage -> {System
.out.printf("Page: %d%n", pageCount[0]++);IterableStream
<MetricEnrichedSeriesData
> pageElements = enrichedDataPage.getElements(); for (MetricEnrichedSeriesData
enrichedData : pageElements) {System
.out.printf("Series Key %s%n:", enrichedData.getSeriesKey().asMap());System
.out.println("List of data points for this series");System
.out.println(enrichedData.getMetricValues());System
.out.println("Timestamps of the data related to this time series:");System
.out.println(enrichedData.getTimestamps());System
.out.println("The expected values of the data points calculated by the smart detector:");System
.out.println(enrichedData.getExpectedMetricValues());System
.out.println("The lower boundary values of the data points calculated by smart detector:");System
.out.println(enrichedData.getLowerBoundaryValues());System
.out.println("the periods calculated for the data points in the time series:");System
.out.println(enrichedData.getPeriods()); } });
detectionConfigurationId
- The id of the configuration used to enrich the time series
identified by the keys in seriesKeys
.seriesKeys
- The time series key list, each key identifies a specific time series.startTime
- The start time of the time range within which the enriched data is returned.endTime
- The end time of the time range within which the enriched data is returned.context
- Additional context that is passed through the Http pipeline during the service call.IllegalArgumentException
- thrown if detectionConfigurationId
fail the UUID format validation
or if seriesKeys
is empty.NullPointerException
- thrown if the detectionConfigurationId
or startTime
or endTime
is null.public com.azure.core.http.rest.PagedIterable<DataPointAnomaly> listAnomaliesForDetectionConfig(String detectionConfigurationId, OffsetDateTime startTime, OffsetDateTime endTime)
Code sample
finalString
detectionConfigurationId = "c0f2539f-b804-4ab9-a70f-0da0c89c76d8"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T12:00:00Z"); finalListAnomaliesDetectedFilter
filter = newListAnomaliesDetectedFilter
() .setSeverityRange(AnomalySeverity
.LOW,AnomalySeverity
.MEDIUM); finalListAnomaliesDetectedOptions
options = newListAnomaliesDetectedOptions
() .setMaxPageSize(10) .setFilter(filter);PagedIterable
<DataPointAnomaly
> anomaliesIterable = metricsAdvisorClient.listAnomaliesForDetectionConfig(detectionConfigurationId, startTime, endTime, options,Context
.NONE); for (DataPointAnomaly
dataPointAnomaly : anomaliesIterable) {System
.out.printf("DataPointAnomaly AnomalySeverity: %s%n", dataPointAnomaly.getSeverity());System
.out.printf("Series Key:");DimensionKey
seriesKey = dataPointAnomaly.getSeriesKey(); for (Map
.Entry<String
,String
> dimension : seriesKey.asMap().entrySet()) {System
.out.printf("DimensionName: %s DimensionValue:%s%n", dimension.getKey(), dimension.getValue()); } }
detectionConfigurationId
- The anomaly detection configuration id.startTime
- The start time of the time range within which the anomalies were detected.endTime
- The end time of the time range within which the anomalies were detected.IllegalArgumentException
- thrown if detectionConfigurationId
does not conform
to the UUID format specification
or options.filter
is used to set severity but either min or max severity is missing.NullPointerException
- thrown if the detectionConfigurationId
or
startTime
or endTime
is null.public com.azure.core.http.rest.PagedIterable<DataPointAnomaly> listAnomaliesForDetectionConfig(String detectionConfigurationId, OffsetDateTime startTime, OffsetDateTime endTime, ListAnomaliesDetectedOptions options, com.azure.core.util.Context context)
Code sample
finalString
detectionConfigurationId = "c0f2539f-b804-4ab9-a70f-0da0c89c76d8"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T12:00:00Z"); finalListAnomaliesDetectedFilter
filter = newListAnomaliesDetectedFilter
() .setSeverityRange(AnomalySeverity
.LOW,AnomalySeverity
.MEDIUM); finalListAnomaliesDetectedOptions
options = newListAnomaliesDetectedOptions
() .setMaxPageSize(10) .setFilter(filter);PagedIterable
<DataPointAnomaly
> anomaliesIterable = metricsAdvisorClient.listAnomaliesForDetectionConfig(detectionConfigurationId, startTime, endTime, options,Context
.NONE);Stream
<PagedResponse
<DataPointAnomaly
>> anomaliesPageStream = anomaliesIterable.streamByPage(); int[] pageCount = new int[1]; anomaliesPageStream.forEach(anomaliesPage -> {System
.out.printf("Page: %d%n", pageCount[0]++);IterableStream
<DataPointAnomaly
> anomaliesPageItems = anomaliesPage.getElements(); for (DataPointAnomaly
dataPointAnomaly : anomaliesPageItems) {System
.out.printf("DataPoint Anomaly AnomalySeverity: %s%n", dataPointAnomaly.getSeverity());System
.out.printf("Series Key:");DimensionKey
seriesKey = dataPointAnomaly.getSeriesKey(); for (Map
.Entry<String
,String
> dimension : seriesKey.asMap().entrySet()) {System
.out.printf("DimensionName: %s DimensionValue:%s%n", dimension.getKey(), dimension.getValue()); } } });
detectionConfigurationId
- The anomaly detection configuration id.startTime
- The start time of the time range within which the anomalies were detected.endTime
- The end time of the time range within which the anomalies were detected.options
- The additional parameters.context
- Additional context that is passed through the Http pipeline during the service call.IllegalArgumentException
- thrown if detectionConfigurationId
does not conform
to the UUID format specification
or options.filter
is used to set severity but either min or max severity is missing.NullPointerException
- thrown if the detectionConfigurationId
or startTime
or
endTime
is null.public com.azure.core.http.rest.PagedIterable<AnomalyIncident> listIncidentsForDetectionConfig(String detectionConfigurationId, OffsetDateTime startTime, OffsetDateTime endTime)
Code sample
finalString
detectionConfigurationId = "c0f2539f-b804-4ab9-a70f-0da0c89c76d8"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T12:00:00Z");PagedIterable
<AnomalyIncident
> incidentsIterable = metricsAdvisorClient.listIncidentsForDetectionConfig(detectionConfigurationId, startTime, endTime); for (AnomalyIncident
anomalyIncident : incidentsIterable) {System
.out.printf("Data Feed Metric Id: %s%n", anomalyIncident.getMetricId());System
.out.printf("Detection Configuration Id: %s%n", anomalyIncident.getDetectionConfigurationId());System
.out.printf("Anomaly Incident Id: %s%n", anomalyIncident.getId());System
.out.printf("Anomaly Incident Start Time: %s%n", anomalyIncident.getStartTime());System
.out.printf("Anomaly Incident AnomalySeverity: %s%n", anomalyIncident.getSeverity());System
.out.printf("Anomaly Incident Status: %s%n", anomalyIncident.getStatus());System
.out.printf("Root DataFeedDimension Key: %s%n", anomalyIncident.getRootDimensionKey().asMap()); }
detectionConfigurationId
- The anomaly detection configuration id.startTime
- The start time of the time range within which the incidents were detected.endTime
- The end time of the time range within which the incidents were detected.IllegalArgumentException
- thrown if detectionConfigurationId
does not conform
to the UUID format specification.NullPointerException
- thrown if the detectionConfigurationId
or options
or startTime
or endTime
is null.public com.azure.core.http.rest.PagedIterable<AnomalyIncident> listIncidentsForDetectionConfig(String detectionConfigurationId, OffsetDateTime startTime, OffsetDateTime endTime, ListIncidentsDetectedOptions options, com.azure.core.util.Context context)
Code sample
finalString
detectionConfigurationId = "c0f2539f-b804-4ab9-a70f-0da0c89c76d8"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T12:00:00Z"); finalListIncidentsDetectedOptions
options = newListIncidentsDetectedOptions
() .setMaxPageSize(1000);PagedIterable
<AnomalyIncident
> incidentsIterable = metricsAdvisorClient.listIncidentsForDetectionConfig(detectionConfigurationId, startTime, endTime, options,Context
.NONE);Stream
<PagedResponse
<AnomalyIncident
>> incidentsPageStream = incidentsIterable.streamByPage(); int[] pageCount = new int[1]; incidentsPageStream.forEach(incidentsPage -> {System
.out.printf("Page: %d%n", pageCount[0]++);IterableStream
<AnomalyIncident
> pageElements = incidentsPage.getElements(); for (AnomalyIncident
anomalyIncident : pageElements) {System
.out.printf("Data Feed Metric Id: %s%n", anomalyIncident.getMetricId());System
.out.printf("Detection Configuration Id: %s%n", anomalyIncident.getDetectionConfigurationId());System
.out.printf("Anomaly Incident Id: %s%n", anomalyIncident.getId());System
.out.printf("Anomaly Incident Start Time: %s%n", anomalyIncident.getStartTime());System
.out.printf("Anomaly Incident AnomalySeverity: %s%n", anomalyIncident.getSeverity());System
.out.printf("Anomaly Incident Status: %s%n", anomalyIncident.getStatus());System
.out.printf("Root DataFeedDimension Key:");System
.out.printf("Root DataFeedDimension Key: %s%n", anomalyIncident.getRootDimensionKey().asMap()); } });
detectionConfigurationId
- The anomaly detection configuration id.startTime
- The start time of the time range within which the incidents were detected.endTime
- The end time of the time range within which the incidents were detected.options
- The additional parameters.context
- Additional context that is passed through the Http pipeline during the service call.IllegalArgumentException
- thrown if detectionConfigurationId
does not conform
to the UUID format specification.NullPointerException
- thrown if the detectionConfigurationId
or startTime
or
endTime
is null.public com.azure.core.http.rest.PagedIterable<IncidentRootCause> listIncidentRootCauses(String detectionConfigurationId, String incidentId)
Code sample
finalString
detectionConfigurationId = "c0dddf2539f-b804-4ab9-a70f-0da0c89c76d8"; finalString
incidentId = "c5thh0f2539f-b804-4ab9-a70f-0da0c89c456d"; metricsAdvisorClient.listIncidentRootCauses(detectionConfigurationId, incidentId) .forEach(incidentRootCause -> {System
.out.printf("Description: %s%n", incidentRootCause.getDescription());System
.out.printf("Series Key:");System
.out.println(incidentRootCause.getSeriesKey().asMap());System
.out.printf("Confidence for the detected incident root cause %.2f%n", incidentRootCause.getContributionScore()); });
detectionConfigurationId
- anomaly detection configuration unique id.incidentId
- the incident for which you want to query root causes for.IllegalArgumentException
- thrown if detectionConfigurationId
fail the UUID format validation.MetricsAdvisorResponseException
- thrown if the request is rejected by server.NullPointerException
- thrown if the detectionConfigurationId
or incidentId
is null.public com.azure.core.http.rest.PagedIterable<IncidentRootCause> listIncidentRootCauses(String detectionConfigurationId, String incidentId, com.azure.core.util.Context context)
Code sample
finalString
detectionConfigurationId = "c0dddf2539f-b804-4ab9-a70f-0da0c89c76d8"; finalString
incidentId = "c5thh0f2539f-b804-4ab9-a70f-0da0c89c456d";PagedIterable
<IncidentRootCause
> rootCauseIterable = metricsAdvisorClient.listIncidentRootCauses(detectionConfigurationId, incidentId,Context
.NONE);Stream
<PagedResponse
<IncidentRootCause
>> rootCausePageIterable = rootCauseIterable.streamByPage(); rootCausePageIterable.forEach(response -> {System
.out.printf("Response StatusCode: %s%n", response.getStatusCode());IterableStream
<IncidentRootCause
> pageElements = response.getElements(); for (IncidentRootCause
incidentRootCause : pageElements) {System
.out.printf("Description: %s%n", incidentRootCause.getDescription());System
.out.printf("Series Key:");System
.out.println(incidentRootCause.getSeriesKey().asMap());System
.out.printf("Confidence for the detected incident root cause %.2f%n", incidentRootCause.getContributionScore()); } });
detectionConfigurationId
- anomaly detection configuration unique id.incidentId
- the incident for which you want to query root causes for.context
- Additional context that is passed through the Http pipeline during the service call.IllegalArgumentException
- thrown if detectionConfigurationId
fail the UUID format validation.MetricsAdvisorResponseException
- thrown if the request is rejected by server.NullPointerException
- thrown if the detectionConfigurationId
or incidentId
is null.public com.azure.core.http.rest.PagedIterable<IncidentRootCause> listIncidentRootCauses(AnomalyIncident anomalyIncident)
Code sample
finalString
detectionConfigurationId = "c0f2539f-b804-4ab9-a70f-0da0c89c76d8"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-01-01T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); metricsAdvisorClient.listIncidentsForDetectionConfig(detectionConfigurationId, startTime, endTime) .forEach(incident -> { metricsAdvisorClient.listIncidentRootCauses(incident) .forEach(incidentRootCause -> {System
.out.printf("Description: %s%n", incidentRootCause.getDescription());System
.out.printf("Series Key:");System
.out.println(incidentRootCause.getSeriesKey().asMap());System
.out.printf("Confidence for the detected incident root cause %.2f%n", incidentRootCause.getContributionScore()); }); });
anomalyIncident
- the anomalyIncident for which you want to query root causes for.IllegalArgumentException
- thrown if detectionConfigurationId
fail the UUID format validation.MetricsAdvisorResponseException
- thrown if the request is rejected by server.NullPointerException
- thrown if the detectionConfigurationId
or incidentId
is null.public com.azure.core.http.rest.PagedIterable<String> listAnomalyDimensionValues(String detectionConfigurationId, String dimensionName, OffsetDateTime startTime, OffsetDateTime endTime)
Code sample
finalString
detectionConfigurationId = "c0f2539f-b804-4ab9-a70f-0da0c89c76d8"; finalString
dimensionName = "Dim1"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-01-01T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z");PagedIterable
<String
> dimensionValueIterable = metricsAdvisorClient.listAnomalyDimensionValues(detectionConfigurationId, dimensionName, startTime, endTime); for (String
dimensionValue : dimensionValueIterable) {System
.out.printf("DataFeedDimension Value: %s%n", dimensionValue); }
detectionConfigurationId
- Identifies the configuration used to detect the anomalies.dimensionName
- The dimension name to retrieve the values for.startTime
- The start time of the time range within which the anomalies were identified.endTime
- The end time of the time range within which the anomalies were identified.IllegalArgumentException
- thrown if detectionConfigurationId
does not conform
to the UUID format specification.NullPointerException
- thrown if the detectionConfigurationId
or dimensionName
or startTime
or endTime
is null.public com.azure.core.http.rest.PagedIterable<String> listAnomalyDimensionValues(String detectionConfigurationId, String dimensionName, OffsetDateTime startTime, OffsetDateTime endTime, ListAnomalyDimensionValuesOptions options, com.azure.core.util.Context context)
Code sample
finalString
detectionConfigurationId = "c0f2539f-b804-4ab9-a70f-0da0c89c76d8"; finalString
dimensionName = "Dim1"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-01-01T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); finalListAnomalyDimensionValuesOptions
options = newListAnomalyDimensionValuesOptions
() .setMaxPageSize(10);PagedIterable
<String
> dimensionValueIterable = metricsAdvisorClient.listAnomalyDimensionValues(detectionConfigurationId, dimensionName, startTime, endTime, options,Context
.NONE);Stream
<PagedResponse
<String
>> dimensionValuePageStream = dimensionValueIterable.streamByPage(); int[] pageCount = new int[1]; dimensionValuePageStream.forEach(dimensionValuePage -> {System
.out.printf("Page: %d%n", pageCount[0]++);IterableStream
<String
> dimensionValuePageItems = dimensionValuePage.getElements(); for (String
dimensionValue : dimensionValuePageItems) {System
.out.printf("DataFeedDimension Value: %s%n", dimensionValue); } });
detectionConfigurationId
- Identifies the configuration used to detect the anomalies.dimensionName
- The dimension name to retrieve the values for.startTime
- The start time of the time range within which the anomalies were identified.endTime
- The end time of the time range within which the anomalies were identified.options
- The additional parameters.context
- Additional context that is passed through the Http pipeline during the service call.IllegalArgumentException
- thrown if detectionConfigurationId
does not conform
to the UUID format specification.NullPointerException
- thrown if the detectionConfigurationId
or dimensionName
or startTime
or endTime
is null.public com.azure.core.http.rest.PagedIterable<AnomalyAlert> listAlerts(String alertConfigurationId, OffsetDateTime startTime, OffsetDateTime endTime)
Code sample
finalString
alertConfigurationId = "ff3014a0-bbbb-41ec-a637-677e77b81299"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-01-01T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z");PagedIterable
<AnomalyAlert
> alertsIterable = metricsAdvisorClient.listAlerts(alertConfigurationId, startTime, endTime); for (AnomalyAlert
anomalyAlert : alertsIterable) {System
.out.printf("Anomaly Alert Id: %s%n", anomalyAlert.getId());System
.out.printf("Created Time: %s%n", anomalyAlert.getCreatedTime());System
.out.printf("Modified Time: %s%n", anomalyAlert.getModifiedTime()); }
alertConfigurationId
- The anomaly alert configuration id.startTime
- The start time of the time range within which the alerts were triggered.endTime
- The end time of the time range within which the alerts were triggered.IllegalArgumentException
- thrown if alertConfigurationId
does not conform
to the UUID format specification.NullPointerException
- thrown if the alertConfigurationId
or startTime
or endTime
is null.public com.azure.core.http.rest.PagedIterable<AnomalyAlert> listAlerts(String alertConfigurationId, OffsetDateTime startTime, OffsetDateTime endTime, ListAlertOptions options, com.azure.core.util.Context context)
Code sample
finalString
alertConfigurationId = "ff3014a0-bbbb-41ec-a637-677e77b81299"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-01-01T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); finalAlertQueryTimeMode
timeMode =AlertQueryTimeMode
.ANOMALY_TIME; finalListAlertOptions
options = newListAlertOptions
() .setAlertQueryTimeMode(timeMode) .setMaxPageSize(10);PagedIterable
<AnomalyAlert
> alertsIterable = metricsAdvisorClient.listAlerts(alertConfigurationId, startTime, endTime, options,Context
.NONE);Stream
<PagedResponse
<AnomalyAlert
>> alertsPageStream = alertsIterable.streamByPage(); int[] pageCount = new int[1]; alertsPageStream.forEach(alertsPage -> {System
.out.printf("Page: %d%n", pageCount[0]++);IterableStream
<AnomalyAlert
> alertsPageItems = alertsPage.getElements(); for (AnomalyAlert
anomalyAlert : alertsPageItems) {System
.out.printf("AnomalyAlert Id: %s%n", anomalyAlert.getId());System
.out.printf("Created Time: %s%n", anomalyAlert.getCreatedTime());System
.out.printf("Modified Time: %s%n", anomalyAlert.getModifiedTime()); } });
alertConfigurationId
- The anomaly alert configuration id.startTime
- The start time of the time range within which the alerts were triggered.endTime
- The end time of the time range within which the alerts were triggered.options
- The additional parameters.context
- Additional context that is passed through the Http pipeline during the service call.IllegalArgumentException
- thrown if alertConfigurationId
does not conform
to the UUID format specification.NullPointerException
- thrown if the alertConfigurationId
or startTime
or endTime
is null.public com.azure.core.http.rest.PagedIterable<DataPointAnomaly> listAnomaliesForAlert(String alertConfigurationId, String alertId)
Code sample
finalString
alertConfigurationId = "ff3014a0-bbbb-41ec-a637-677e77b81299"; finalString
alertId = "1746b031c00";PagedIterable
<DataPointAnomaly
> anomaliesIterable = metricsAdvisorClient.listAnomaliesForAlert( alertConfigurationId, alertId ); for (DataPointAnomaly
dataPointAnomaly : anomaliesIterable) {System
.out.printf("Data Feed Metric Id: %s%n", dataPointAnomaly.getMetricId());System
.out.printf("Detection Configuration Id: %s%n", dataPointAnomaly.getDetectionConfigurationId());System
.out.printf("DataPoint Anomaly Created Time: %s%n", dataPointAnomaly.getCreatedTime());System
.out.printf("DataPoint Anomaly Modified Time: %s%n", dataPointAnomaly.getModifiedTime());System
.out.printf("DataPoint Anomaly AnomalySeverity: %s%n", dataPointAnomaly.getSeverity());System
.out.printf("DataPoint Anomaly Status: %s%n", dataPointAnomaly.getStatus());System
.out.printf("Series Key:");System
.out.println(dataPointAnomaly.getSeriesKey().asMap()); }
alertConfigurationId
- The anomaly alert configuration id.alertId
- The alert id.IllegalArgumentException
- thrown if alertConfigurationId
or alertId
does not
conform to the UUID format specification.NullPointerException
- thrown if the alertConfigurationId
or alertId
is null.public com.azure.core.http.rest.PagedIterable<DataPointAnomaly> listAnomaliesForAlert(String alertConfigurationId, String alertId, ListAnomaliesAlertedOptions options, com.azure.core.util.Context context)
Code sample
finalString
alertConfigurationId = "ff3014a0-bbbb-41ec-a637-677e77b81299"; finalString
alertId = "1746b031c00"; finalListAnomaliesAlertedOptions
options = newListAnomaliesAlertedOptions
() .setMaxPageSize(10);PagedIterable
<DataPointAnomaly
> anomaliesIterable = metricsAdvisorClient.listAnomaliesForAlert( alertConfigurationId, alertId, options,Context
.NONE);Stream
<PagedResponse
<DataPointAnomaly
>> anomaliesPageStream = anomaliesIterable.streamByPage(); int[] pageCount = new int[1]; anomaliesPageStream.forEach(anomaliesPage -> {System
.out.printf("Page: %d%n", pageCount[0]++);IterableStream
<DataPointAnomaly
> anomaliesPageItems = anomaliesPage.getElements(); for (DataPointAnomaly
dataPointAnomaly : anomaliesPageItems) {System
.out.printf("Data Feed Metric Id: %s%n", dataPointAnomaly.getMetricId());System
.out.printf("Detection Configuration Id: %s%n", dataPointAnomaly.getDetectionConfigurationId());System
.out.printf("DataPoint Anomaly Created Time: %s%n", dataPointAnomaly.getCreatedTime());System
.out.printf("DataPoint Anomaly Modified Time: %s%n", dataPointAnomaly.getModifiedTime());System
.out.printf("DataPoint Anomaly AnomalySeverity: %s%n", dataPointAnomaly.getSeverity());System
.out.printf("DataPoint Anomaly Status: %s%n", dataPointAnomaly.getStatus());System
.out.printf("Series Key:");System
.out.println(dataPointAnomaly.getSeriesKey().asMap()); } });
alertConfigurationId
- The anomaly alert configuration id.alertId
- The alert id.options
- The additional parameters.context
- Additional context that is passed through the Http pipeline during the service call.IllegalArgumentException
- thrown if alertConfigurationId
or alertId
does not
conform to the UUID format specification.NullPointerException
- thrown if the alertConfigurationId
or alertId
is null.public com.azure.core.http.rest.PagedIterable<AnomalyIncident> listIncidentsForAlert(String alertConfigurationId, String alertId)
Code sample
finalString
alertConfigurationId = "ff3014a0-bbbb-41ec-a637-677e77b81299"; finalString
alertId = "1746b031c00";PagedIterable
<AnomalyIncident
> incidentsIterable = metricsAdvisorClient.listIncidentsForAlert( alertConfigurationId, alertId);Stream
<PagedResponse
<AnomalyIncident
>> incidentsPageStream = incidentsIterable.streamByPage(); int[] pageCount = new int[1]; incidentsPageStream.forEach(incidentsPage -> {System
.out.printf("Page: %d%n", pageCount[0]++);IterableStream
<AnomalyIncident
> incidentsPageItems = incidentsPage.getElements(); for (AnomalyIncident
anomalyIncident : incidentsPageItems) {System
.out.printf("Data Feed Metric Id: %s%n", anomalyIncident.getMetricId());System
.out.printf("Detection Configuration Id: %s%n", anomalyIncident.getDetectionConfigurationId());System
.out.printf("Anomaly Incident Id: %s%n", anomalyIncident.getId());System
.out.printf("Anomaly Incident Start Time: %s%n", anomalyIncident.getStartTime());System
.out.printf("Anomaly Incident AnomalySeverity: %s%n", anomalyIncident.getSeverity());System
.out.printf("Anomaly Incident Status: %s%n", anomalyIncident.getStatus());System
.out.printf("Root DataFeedDimension Key:");DimensionKey
rootDimension = anomalyIncident.getRootDimensionKey(); for (Map
.Entry<String
,String
> dimension : rootDimension.asMap().entrySet()) {System
.out.printf("DimensionKey: %s DimensionValue:%s%n", dimension.getKey(), dimension.getValue()); } } });
alertConfigurationId
- The anomaly alert configuration id.alertId
- The alert id.IllegalArgumentException
- thrown if alertConfigurationId
or alertId
does not
conform to the UUID format specification.NullPointerException
- thrown if the alertConfigurationId
or alertId
is null.public com.azure.core.http.rest.PagedIterable<AnomalyIncident> listIncidentsForAlert(String alertConfigurationId, String alertId, ListIncidentsAlertedOptions options, com.azure.core.util.Context context)
Code sample
finalString
alertConfigurationId = "ff3014a0-bbbb-41ec-a637-677e77b81299"; finalString
alertId = "1746b031c00"; finalListIncidentsAlertedOptions
options = newListIncidentsAlertedOptions
() .setMaxPageSize(10);PagedIterable
<AnomalyIncident
> incidentsIterable = metricsAdvisorClient.listIncidentsForAlert( alertConfigurationId, alertId, options,Context
.NONE);Stream
<PagedResponse
<AnomalyIncident
>> incidentsPageStream = incidentsIterable.streamByPage(); int[] pageCount = new int[1]; incidentsPageStream.forEach(incidentsPage -> {System
.out.printf("Page: %d%n", pageCount[0]++);IterableStream
<AnomalyIncident
> incidentsPageItems = incidentsPage.getElements(); for (AnomalyIncident
anomalyIncident : incidentsPageItems) {System
.out.printf("Data Feed Metric Id: %s%n", anomalyIncident.getMetricId());System
.out.printf("Detection Configuration Id: %s%n", anomalyIncident.getDetectionConfigurationId());System
.out.printf("Anomaly Incident Id: %s%n", anomalyIncident.getId());System
.out.printf("Anomaly Incident Start Time: %s%n", anomalyIncident.getStartTime());System
.out.printf("Anomaly Incident AnomalySeverity: %s%n", anomalyIncident.getSeverity());System
.out.printf("Anomaly Incident Status: %s%n", anomalyIncident.getStatus());System
.out.printf("Root DataFeedDimension Key:");DimensionKey
rootDimension = anomalyIncident.getRootDimensionKey(); for (Map
.Entry<String
,String
> dimension : rootDimension.asMap().entrySet()) {System
.out.printf("DimensionKey: %s DimensionValue:%s%n", dimension.getKey(), dimension.getValue()); } } });
alertConfigurationId
- The anomaly alert configuration id.alertId
- The alert id.options
- The additional parameters.context
- Additional context that is passed through the Http pipeline during the service call.IllegalArgumentException
- thrown if alertConfigurationId
or alertId
does not
conform to the UUID format specification.NullPointerException
- thrown if the alertConfigurationId
or alertId
is null.public MetricFeedback addFeedback(String metricId, MetricFeedback metricFeedback)
Code sample
finalString
metricId = "d3gh4i4-b804-4ab9-a70f-0da0c89cft3l"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-01-01T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); finalMetricChangePointFeedback
metricChangePointFeedback = newMetricChangePointFeedback
(startTime, endTime,ChangePointValue
.AUTO_DETECT); finalMetricFeedback
metricFeedback = metricsAdvisorClient.addFeedback(metricId, metricChangePointFeedback);MetricChangePointFeedback
createdMetricChangePointFeedback = (MetricChangePointFeedback
) metricFeedback;System
.out.printf("Data Feed Metric feedback Id: %s%n", createdMetricChangePointFeedback.getId());System
.out.printf("Data Feed Metric feedback change point value: %s%n", createdMetricChangePointFeedback.getChangePointValue().toString());System
.out.printf("Data Feed Metric feedback start time: %s%n", createdMetricChangePointFeedback.getStartTime());System
.out.printf("Data Feed Metric feedback end time: %s%n", createdMetricChangePointFeedback.getEndTime());
metricId
- the unique id for which the feedback needs to be submitted.metricFeedback
- the actual metric feedback.metric feedback
.NullPointerException
- If metricId
, metricFeedback.dimensionFilter
is null.public com.azure.core.http.rest.Response<MetricFeedback> addFeedbackWithResponse(String metricId, MetricFeedback metricFeedback, com.azure.core.util.Context context)
Code sample
finalString
metricId = "d3gh4i4-b804-4ab9-a70f-0da0c89cft3l"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-01-01T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); finalMetricChangePointFeedback
metricChangePointFeedback = newMetricChangePointFeedback
(startTime, endTime,ChangePointValue
.AUTO_DETECT); finalResponse
<MetricFeedback
> metricFeedbackResponse = metricsAdvisorClient.addFeedbackWithResponse(metricId, metricChangePointFeedback,Context
.NONE);System
.out.printf("Data Feed Metric feedback creation operation status %s%n", metricFeedbackResponse.getStatusCode());MetricChangePointFeedback
createdMetricChangePointFeedback = (MetricChangePointFeedback
) metricFeedbackResponse.getValue();System
.out.printf("Data Feed Metric feedback Id: %s%n", createdMetricChangePointFeedback.getId());System
.out.printf("Data Feed Metric feedback change point value: %s%n", createdMetricChangePointFeedback.getChangePointValue().toString());System
.out.printf("Data Feed Metric feedback start time: %s%n", createdMetricChangePointFeedback.getStartTime());System
.out.printf("Data Feed Metric feedback end time: %s%n", createdMetricChangePointFeedback.getEndTime());System
.out.printf("Data Feed Metric feedback associated dimension filter: %s%n", createdMetricChangePointFeedback.getDimensionFilter().asMap());
metricId
- the unique id for which the feedback needs to be submitted.metricFeedback
- the actual metric feedback.context
- Additional context that is passed through the HTTP pipeline during the service call.Response
containing the created metric feedback
.NullPointerException
- If metricId
, metricFeedback.dimensionFilter
is null.public MetricFeedback getFeedback(String feedbackId)
Code sample
finalString
feedbackId = "8i3h4i4-b804-4ab9-a70f-0da0c89cft3l"; finalMetricFeedback
metricFeedback = metricsAdvisorClient.getFeedback(feedbackId);System
.out.printf("Data Feed Metric feedback Id: %s%n", metricFeedback.getId());System
.out.printf("Data Feed Metric feedback associated dimension filter: %s%n", metricFeedback.getDimensionFilter().asMap()); if (PERIOD.equals(metricFeedback.getFeedbackType())) {MetricPeriodFeedback
createMetricPeriodFeedback = (MetricPeriodFeedback
) metricFeedback;System
.out.printf("Data Feed Metric feedback type: %s%n", createMetricPeriodFeedback.getPeriodType().toString());System
.out.printf("Data Feed Metric feedback period value: %d%n", createMetricPeriodFeedback.getPeriodValue()); }
feedbackId
- The metric feedback unique id.IllegalArgumentException
- If feedbackId
does not conform to the UUID format specification.NullPointerException
- thrown if the feedbackId
is null.public com.azure.core.http.rest.Response<MetricFeedback> getFeedbackWithResponse(String feedbackId, com.azure.core.util.Context context)
Code sample
finalString
feedbackId = "8i3h4i4-b804-4ab9-a70f-0da0c89cft3l"; finalResponse
<MetricFeedback
> metricFeedbackResponse = metricsAdvisorClient.getFeedbackWithResponse(feedbackId,Context
.NONE); finalMetricFeedback
metricFeedback = metricFeedbackResponse.getValue();System
.out.printf("Data Feed Metric feedback Id: %s%n", metricFeedback.getId());System
.out.printf("Data Feed Metric feedback associated dimension filter: %s%n", metricFeedback.getDimensionFilter().asMap()); if (PERIOD.equals(metricFeedback.getFeedbackType())) {MetricPeriodFeedback
createMetricPeriodFeedback = (MetricPeriodFeedback
) metricFeedback;System
.out.printf("Data Feed Metric feedback type: %s%n", createMetricPeriodFeedback.getPeriodType().toString());System
.out.printf("Data Feed Metric feedback period value: %d%n", createMetricPeriodFeedback.getPeriodValue()); }
feedbackId
- The metric feedback unique id.context
- Additional context that is passed through the HTTP pipeline during the service call.IllegalArgumentException
- If feedbackId
does not conform to the UUID format specification.NullPointerException
- thrown if the feedbackId
is null.public com.azure.core.http.rest.PagedIterable<MetricFeedback> listFeedback(String metricId)
Code sample
finalString
metricId = "d3gh4i4-b804-4ab9-a70f-0da0c89cft3l"; metricsAdvisorClient.listFeedback(metricId) .forEach(metricFeedback -> {System
.out.printf("Data Feed Metric feedback Id: %s%n", metricFeedback.getId());System
.out.printf("Data Feed Metric feedback associated dimension filter: %s%n", metricFeedback.getDimensionFilter().asMap()); if (PERIOD.equals(metricFeedback.getFeedbackType())) {MetricPeriodFeedback
periodFeedback = (MetricPeriodFeedback
) metricFeedback;System
.out.printf("Data Feed Metric feedback type: %s%n", periodFeedback.getPeriodType().toString());System
.out.printf("Data Feed Metric feedback period value: %d%n", periodFeedback.getPeriodValue()); } else if (ANOMALY.equals(metricFeedback.getFeedbackType())) {MetricAnomalyFeedback
metricAnomalyFeedback = (MetricAnomalyFeedback
) metricFeedback;System
.out.printf("Data Feed Metric feedback anomaly value: %s%n", metricAnomalyFeedback.getAnomalyValue().toString());System
.out.printf("Data Feed Metric feedback associated detection configuration: %s%n", metricAnomalyFeedback.getDetectionConfigurationId()); } else if (COMMENT.equals(metricFeedback.getFeedbackType())) {MetricCommentFeedback
metricCommentFeedback = (MetricCommentFeedback
) metricFeedback;System
.out.printf("Data Feed Metric feedback comment value: %s%n", metricCommentFeedback.getComment()); } });
metricId
- the unique metric Id.PagedIterable
containing information of all the metric feedbacks
in the account.IllegalArgumentException
- thrown if metricId
fail the UUID format validation.MetricsAdvisorResponseException
- thrown if the request is rejected by server.NullPointerException
- thrown if the metricId
is null.public com.azure.core.http.rest.PagedIterable<MetricFeedback> listFeedback(String metricId, ListMetricFeedbackOptions options, com.azure.core.util.Context context)
Code sample
finalString
metricId = "d3gh4i4-b804-4ab9-a70f-0da0c89cft3l"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-01-01T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); metricsAdvisorClient.listFeedback(metricId, newListMetricFeedbackOptions
() .setFilter(newListMetricFeedbackFilter
() .setStartTime(startTime) .setTimeMode(FeedbackQueryTimeMode
.FEEDBACK_CREATED_TIME) .setEndTime(endTime)),Context
.NONE) .forEach(metricFeedback -> {System
.out.printf("Data Feed Metric feedback Id: %s%n", metricFeedback.getId());System
.out.printf("Data Feed Metric feedback associated dimension filter: %s%n", metricFeedback.getDimensionFilter().asMap());System
.out.printf("Data Feed Metric feedback created time %s%n", metricFeedback.getCreatedTime()); if (PERIOD.equals(metricFeedback.getFeedbackType())) {MetricPeriodFeedback
periodFeedback = (MetricPeriodFeedback
) metricFeedback;System
.out.printf("Data Feed Metric feedback type: %s%n", periodFeedback.getPeriodType().toString());System
.out.printf("Data Feed Metric feedback period value: %d%n", periodFeedback.getPeriodValue()); } else if (ANOMALY.equals(metricFeedback.getFeedbackType())) {MetricAnomalyFeedback
metricAnomalyFeedback = (MetricAnomalyFeedback
) metricFeedback;System
.out.printf("Data Feed Metric feedback anomaly value: %s%n", metricAnomalyFeedback.getAnomalyValue().toString());System
.out.printf("Data Feed Metric feedback associated detection configuration: %s%n", metricAnomalyFeedback.getDetectionConfigurationId()); } else if (COMMENT.equals(metricFeedback.getFeedbackType())) {MetricCommentFeedback
metricCommentFeedback = (MetricCommentFeedback
) metricFeedback;System
.out.printf("Data Feed Metric feedback comment value: %s%n", metricCommentFeedback.getComment()); } });
metricId
- the unique metric Id.options
- The configurable options
to pass for filtering the output
result.context
- Additional context that is passed through the HTTP pipeline during the service call.PagedIterable
containing information of all the metric feedbacks
in the account.IllegalArgumentException
- thrown if metricId
fail the UUID format validation.MetricsAdvisorResponseException
- thrown if the request is rejected by server.NullPointerException
- thrown if the metricId
is null.public com.azure.core.http.rest.PagedIterable<String> listMetricDimensionValues(String metricId, String dimensionName)
Code sample
finalString
metricId = "gh3014a0-41ec-a637-677e77b81455"; metricsAdvisorClient.listMetricDimensionValues(metricId, "category") .forEach(System
.out::println);
metricId
- metric unique id.dimensionName
- the query dimension name.PagedIterable
of the dimension values for that metric.IllegalArgumentException
- thrown if metricId
fail the UUID format validation.MetricsAdvisorResponseException
- thrown if the request is rejected by server.NullPointerException
- thrown if the metricId
or dimensionName
is null.public com.azure.core.http.rest.PagedIterable<String> listMetricDimensionValues(String metricId, String dimensionName, ListMetricDimensionValuesOptions options, com.azure.core.util.Context context)
Code sample
finalString
metricId = "gh3014a0-41ec-a637-677e77b81455"; metricsAdvisorClient.listMetricDimensionValues(metricId, "category", newListMetricDimensionValuesOptions
().setDimensionValueToFilter("Electronics") .setMaxPageSize(3),Context
.NONE) .forEach(System
.out::println);
metricId
- metric unique id.dimensionName
- the query dimension name.options
- the additional parameters to specify while querying.context
- Additional context that is passed through the HTTP pipeline during the service call.PagedIterable
of the dimension values for that metric.IllegalArgumentException
- thrown if metricId
fail the UUID format validation.MetricsAdvisorResponseException
- thrown if the request is rejected by server.NullPointerException
- thrown if the metricId
or dimensionName
is null.Copyright © 2021 Microsoft Corporation. All rights reserved.