Skip to content

Commit

Permalink
[MetricsAdvisor] API design and renaming updates (Azure#16732)
Browse files Browse the repository at this point in the history
  • Loading branch information
samvaity authored Nov 5, 2020
1 parent b9c9e55 commit 2383dfc
Show file tree
Hide file tree
Showing 134 changed files with 3,310 additions and 3,775 deletions.
12 changes: 12 additions & 0 deletions sdk/metricsadvisor/azure-ai-metricsadvisor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

## 1.0.0-beta.2 (Unreleased)

### Breaking changes
- Updated `createdDataFeed` method to take one `DataFeed` object.
- Renamed `listValuesOfDimensionWithAnomalies` method to `listDimensionValuesWithAnomalies`.
- Renamed model `ListValuesOfDimensionWithAnomaliesOptions` method to `ListDimensionValuesWithAnomaliesOptions`.
- Renamed properties `viewers` , `admins` and their accessors to `viewerEmails` and `adminEmails` respectively on
`DataFeedOptions` model.
- Renamed model `DataSourceMissingDataPointFillType` to `DataFeedMissingDataPointFillType`.
- Renamed properties on `MetricEnrichedSeriesData` and `MetricSeriesData` model.
- Renamed method `setSeverity` to `setSeverityRangeCondition` on `MetricAnomalyAlertConditions` model.
- Renamed property `confidenceScore` to `contributionScore` and its accessors on `IncidentRootCause` model.
- Removed model `ListMetricSeriesData` as top and skip parameters are not valid for this API.
- Moved `startTime` and `endTime` to positional arguments on several methods as they are required.

## 1.0.0-beta.1 (2020-10-07)
Version 1.0.0-beta.1 is a preview of our efforts in creating a Azure Metrics Advisor client library that is developer-friendly
Expand Down
184 changes: 95 additions & 89 deletions sdk/metricsadvisor/azure-ai-metricsadvisor/README.md

Large diffs are not rendered by default.

14 changes: 0 additions & 14 deletions sdk/metricsadvisor/azure-ai-metricsadvisor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@
<tag>HEAD</tag>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
<jacoco.min.branchcoverage>0.49</jacoco.min.branchcoverage>
<jacoco.min.linecoverage>0.68</jacoco.min.linecoverage>
</properties>

<dependencies>
<dependency>
<groupId>com.azure</groupId>
Expand Down Expand Up @@ -107,13 +100,6 @@
--add-exports com.azure.core/com.azure.core.implementation.http=ALL-UNNAMED
--add-opens com.azure.ai.metricsadvisor/com.azure.ai.metricsadvisor=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-surefire-plugin;external_dependency} -->
<configuration>
<systemPropertyVariables>
<!-- Parallel runs disabled due to subscriber timeout issue causing failures in tests. -->
<!-- https://github.com/Azure/azure-sdk-for-java/issues/17069 -->
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.azure.ai.metricsadvisor.implementation.models.EnrichmentStatusList;
import com.azure.ai.metricsadvisor.implementation.models.EnrichmentStatusQueryOption;
import com.azure.ai.metricsadvisor.implementation.models.EntityStatus;
import com.azure.ai.metricsadvisor.models.AnomalyAlert;
import com.azure.ai.metricsadvisor.models.ErrorCodeException;
import com.azure.ai.metricsadvisor.implementation.models.Granularity;
import com.azure.ai.metricsadvisor.implementation.models.HookInfo;
Expand All @@ -53,7 +54,6 @@
import com.azure.ai.metricsadvisor.implementation.models.RootCauseList;
import com.azure.ai.metricsadvisor.implementation.models.SeriesResultList;
import com.azure.ai.metricsadvisor.implementation.models.UsageStats;
import com.azure.ai.metricsadvisor.models.Alert;
import com.azure.ai.metricsadvisor.models.DataFeedIngestionProgress;
import com.azure.ai.metricsadvisor.models.DataFeedIngestionStatus;
import com.azure.ai.metricsadvisor.models.EnrichmentStatus;
Expand Down Expand Up @@ -1086,7 +1086,7 @@ public void createAnomalyAlertingConfiguration(AnomalyAlertingConfiguration body
* @return the response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<PagedResponse<Alert>> getAlertsByAnomalyAlertingConfigurationSinglePageAsync(
public Mono<PagedResponse<AnomalyAlert>> getAlertsByAnomalyAlertingConfigurationSinglePageAsync(
UUID configurationId, AlertingResultQuery body, Integer skip, Integer top) {
return FluxUtil.withContext(
context ->
Expand Down Expand Up @@ -1117,7 +1117,7 @@ public Mono<PagedResponse<Alert>> getAlertsByAnomalyAlertingConfigurationSingleP
* @return the response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<PagedResponse<Alert>> getAlertsByAnomalyAlertingConfigurationSinglePageAsync(
public Mono<PagedResponse<AnomalyAlert>> getAlertsByAnomalyAlertingConfigurationSinglePageAsync(
UUID configurationId, AlertingResultQuery body, Integer skip, Integer top, Context context) {
return service.getAlertsByAnomalyAlertingConfiguration(
this.getEndpoint(), configurationId, skip, top, body, context)
Expand Down Expand Up @@ -1145,7 +1145,7 @@ public Mono<PagedResponse<Alert>> getAlertsByAnomalyAlertingConfigurationSingleP
* @return the response.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<Alert> getAlertsByAnomalyAlertingConfigurationAsync(
public PagedFlux<AnomalyAlert> getAlertsByAnomalyAlertingConfigurationAsync(
UUID configurationId, AlertingResultQuery body, Integer skip, Integer top) {
return new PagedFlux<>(
() -> getAlertsByAnomalyAlertingConfigurationSinglePageAsync(configurationId, body, skip, top),
Expand All @@ -1166,7 +1166,7 @@ public PagedFlux<Alert> getAlertsByAnomalyAlertingConfigurationAsync(
* @return the response.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<Alert> getAlertsByAnomalyAlertingConfigurationAsync(
public PagedFlux<AnomalyAlert> getAlertsByAnomalyAlertingConfigurationAsync(
UUID configurationId, AlertingResultQuery body, Integer skip, Integer top, Context context) {
return new PagedFlux<>(
() -> getAlertsByAnomalyAlertingConfigurationSinglePageAsync(configurationId, body, skip, top, context),
Expand All @@ -1186,7 +1186,7 @@ public PagedFlux<Alert> getAlertsByAnomalyAlertingConfigurationAsync(
* @return the response.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<Alert> getAlertsByAnomalyAlertingConfiguration(
public PagedIterable<AnomalyAlert> getAlertsByAnomalyAlertingConfiguration(
UUID configurationId, AlertingResultQuery body, Integer skip, Integer top) {
return new PagedIterable<>(getAlertsByAnomalyAlertingConfigurationAsync(configurationId, body, skip, top));
}
Expand All @@ -1205,7 +1205,7 @@ public PagedIterable<Alert> getAlertsByAnomalyAlertingConfiguration(
* @return the response.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<Alert> getAlertsByAnomalyAlertingConfiguration(
public PagedIterable<AnomalyAlert> getAlertsByAnomalyAlertingConfiguration(
UUID configurationId, AlertingResultQuery body, Integer skip, Integer top, Context context) {
return new PagedIterable<>(
getAlertsByAnomalyAlertingConfigurationAsync(configurationId, body, skip, top, context));
Expand Down Expand Up @@ -5003,7 +5003,7 @@ public PagedIterable<EnrichmentStatus> getEnrichmentStatusByMetric(
* @return the response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<PagedResponse<Alert>> getAlertsByAnomalyAlertingConfigurationNextSinglePageAsync(
public Mono<PagedResponse<AnomalyAlert>> getAlertsByAnomalyAlertingConfigurationNextSinglePageAsync(
String nextLink, AlertingResultQuery body) {
return FluxUtil.withContext(
context ->
Expand Down Expand Up @@ -5032,7 +5032,7 @@ public Mono<PagedResponse<Alert>> getAlertsByAnomalyAlertingConfigurationNextSin
* @return the response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<PagedResponse<Alert>> getAlertsByAnomalyAlertingConfigurationNextSinglePageAsync(
public Mono<PagedResponse<AnomalyAlert>> getAlertsByAnomalyAlertingConfigurationNextSinglePageAsync(
String nextLink, AlertingResultQuery body, Context context) {
return service.getAlertsByAnomalyAlertingConfigurationNext(this.getEndpoint(), nextLink, body, context)
.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

package com.azure.ai.metricsadvisor.implementation.models;

import com.azure.ai.metricsadvisor.models.Alert;
import com.azure.ai.metricsadvisor.models.AnomalyAlert;
import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

/** The AlertResultList model. */
Expand All @@ -22,7 +23,7 @@ public final class AlertResultList {
* The value property.
*/
@JsonProperty(value = "value", required = true)
private List<Alert> value;
private List<AnomalyAlert> value;

/**
* Get the nextLink property: The @nextLink property.
Expand All @@ -49,7 +50,7 @@ public AlertResultList setNextLink(String nextLink) {
*
* @return the value value.
*/
public List<Alert> getValue() {
public List<AnomalyAlert> getValue() {
return this.value;
}

Expand All @@ -59,7 +60,7 @@ public List<Alert> getValue() {
* @param value the value value to set.
* @return the AlertResultList object itself.
*/
public AlertResultList setValue(List<Alert> value) {
public AlertResultList setValue(List<AnomalyAlert> value) {
this.value = value;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package com.azure.ai.metricsadvisor.implementation.models;

import com.azure.ai.metricsadvisor.models.TimeMode;
import com.azure.ai.metricsadvisor.models.AlertQueryTimeMode;
import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
Expand All @@ -28,7 +28,7 @@ public final class AlertingResultQuery {
* time mode
*/
@JsonProperty(value = "timeMode", required = true)
private TimeMode timeMode;
private AlertQueryTimeMode timeMode;

/**
* Get the startTime property: start time.
Expand Down Expand Up @@ -75,7 +75,7 @@ public AlertingResultQuery setEndTime(OffsetDateTime endTime) {
*
* @return the timeMode value.
*/
public TimeMode getTimeMode() {
public AlertQueryTimeMode getTimeMode() {
return this.timeMode;
}

Expand All @@ -85,7 +85,7 @@ public TimeMode getTimeMode() {
* @param timeMode the timeMode value to set.
* @return the AlertingResultQuery object itself.
*/
public AlertingResultQuery setTimeMode(TimeMode timeMode) {
public AlertingResultQuery setTimeMode(AlertQueryTimeMode timeMode) {
this.timeMode = timeMode;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

package com.azure.ai.metricsadvisor.implementation.models;

import com.azure.ai.metricsadvisor.models.AnomalySeverity;
import com.azure.ai.metricsadvisor.models.AnomalyStatus;
import com.azure.ai.metricsadvisor.models.Severity;
import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

Expand All @@ -16,7 +16,7 @@ public final class AnomalyProperty {
* anomaly severity
*/
@JsonProperty(value = "anomalySeverity", required = true)
private Severity anomalySeverity;
private AnomalySeverity anomalySeverity;

/*
* anomaly status
Expand All @@ -31,7 +31,7 @@ public final class AnomalyProperty {
*
* @return the anomalySeverity value.
*/
public Severity getAnomalySeverity() {
public AnomalySeverity getAnomalySeverity() {
return this.anomalySeverity;
}

Expand All @@ -41,7 +41,7 @@ public Severity getAnomalySeverity() {
* @param anomalySeverity the anomalySeverity value to set.
* @return the AnomalyProperty object itself.
*/
public AnomalyProperty setAnomalySeverity(Severity anomalySeverity) {
public AnomalyProperty setAnomalySeverity(AnomalySeverity anomalySeverity) {
this.anomalySeverity = anomalySeverity;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

package com.azure.ai.metricsadvisor.implementation.models;

import com.azure.ai.metricsadvisor.models.Dimension;
import com.azure.ai.metricsadvisor.models.Metric;
import com.azure.ai.metricsadvisor.models.DataFeedDimension;
import com.azure.ai.metricsadvisor.models.DataFeedMetric;
import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
Expand All @@ -17,10 +17,10 @@

/** The DataFeedDetail model. */
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
property = "dataSourceType",
defaultImpl = DataFeedDetail.class)
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
property = "dataSourceType",
defaultImpl = DataFeedDetail.class)
@JsonTypeName("DataFeedDetail")
@JsonSubTypes({
@JsonSubTypes.Type(name = "AzureApplicationInsights", value = AzureApplicationInsightsDataFeed.class),
Expand Down Expand Up @@ -73,13 +73,13 @@ public class DataFeedDetail {
* measure list
*/
@JsonProperty(value = "metrics", required = true)
private List<Metric> metrics;
private List<DataFeedMetric> metrics;

/*
* dimension list
*/
@JsonProperty(value = "dimension")
private List<Dimension> dimension;
private List<DataFeedDimension> dimension;

/*
* user-defined timestamp column. if timestampColumn is null, start time of
Expand Down Expand Up @@ -299,7 +299,7 @@ public DataFeedDetail setGranularityAmount(Integer granularityAmount) {
*
* @return the metrics value.
*/
public List<Metric> getMetrics() {
public List<DataFeedMetric> getMetrics() {
return this.metrics;
}

Expand All @@ -309,7 +309,7 @@ public List<Metric> getMetrics() {
* @param metrics the metrics value to set.
* @return the DataFeedDetail object itself.
*/
public DataFeedDetail setMetrics(List<Metric> metrics) {
public DataFeedDetail setMetrics(List<DataFeedMetric> metrics) {
this.metrics = metrics;
return this;
}
Expand All @@ -319,7 +319,7 @@ public DataFeedDetail setMetrics(List<Metric> metrics) {
*
* @return the dimension value.
*/
public List<Dimension> getDimension() {
public List<DataFeedDimension> getDimension() {
return this.dimension;
}

Expand All @@ -329,7 +329,7 @@ public List<Dimension> getDimension() {
* @param dimension the dimension value to set.
* @return the DataFeedDetail object itself.
*/
public DataFeedDetail setDimension(List<Dimension> dimension) {
public DataFeedDetail setDimension(List<DataFeedDimension> dimension) {
this.dimension = dimension;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

package com.azure.ai.metricsadvisor.implementation.models;

import com.azure.ai.metricsadvisor.models.IncidentStatus;
import com.azure.ai.metricsadvisor.models.Severity;
import com.azure.ai.metricsadvisor.models.AnomalyIncidentStatus;
import com.azure.ai.metricsadvisor.models.AnomalySeverity;
import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

Expand All @@ -16,22 +16,22 @@ public final class IncidentProperty {
* max severity of latest anomalies in the incident
*/
@JsonProperty(value = "maxSeverity", required = true)
private Severity maxSeverity;
private AnomalySeverity maxSeverity;

/*
* incident status
*
* only return for alerting incident result
*/
@JsonProperty(value = "incidentStatus", access = JsonProperty.Access.WRITE_ONLY)
private IncidentStatus incidentStatus;
private AnomalyIncidentStatus incidentStatus;

/**
* Get the maxSeverity property: max severity of latest anomalies in the incident.
*
* @return the maxSeverity value.
*/
public Severity getMaxSeverity() {
public AnomalySeverity getMaxSeverity() {
return this.maxSeverity;
}

Expand All @@ -41,7 +41,7 @@ public Severity getMaxSeverity() {
* @param maxSeverity the maxSeverity value to set.
* @return the IncidentProperty object itself.
*/
public IncidentProperty setMaxSeverity(Severity maxSeverity) {
public IncidentProperty setMaxSeverity(AnomalySeverity maxSeverity) {
this.maxSeverity = maxSeverity;
return this;
}
Expand All @@ -53,7 +53,7 @@ public IncidentProperty setMaxSeverity(Severity maxSeverity) {
*
* @return the incidentStatus value.
*/
public IncidentStatus getIncidentStatus() {
public AnomalyIncidentStatus getIncidentStatus() {
return this.incidentStatus;
}
}
Loading

0 comments on commit 2383dfc

Please sign in to comment.