Skip to content

Commit

Permalink
[MetricsAdvisor] Fix missed rename updates and typo (Azure#12351)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremymeng authored Nov 7, 2020
1 parent e918a3e commit ae679b5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ async function updateDataFeed(client, dataFeedId) {
const updated = await client.updateDataFeed(dataFeedId, patch);
console.dir(updated);
} catch (err) {
console.log("Error occured when updating data feed");
console.log("Error occurred when updating data feed");
console.log(err);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async function listIncidentsForDetectionConfig(client, detectionConfigId) {
console.log(` status: ${incident.status}`);
console.log(` root dimension key: ${incident.rootDimensionKey}`);
console.log(` startTime: ${incident.startTime}`);
console.log(` last occured: ${incident.lastOccurredTime}`);
console.log(` last occurred: ${incident.lastOccurredTime}`);
console.log(` detection config id: ${incident.detectionConfigurationId}`);
}

Expand Down Expand Up @@ -141,12 +141,7 @@ async function listAlerts(client, alertConfigId) {

console.log(` by pages`);
const iterator = client
.listAlerts(
alertConfigId,
new Date("11/01/2020"),
new Date("11/05/2020"),
"AnomalyTime"
)
.listAlerts(alertConfigId, new Date("11/01/2020"), new Date("11/05/2020"), "AnomalyTime")
.byPage({ maxPageSize: 20 });

let result = await iterator.next();
Expand All @@ -170,7 +165,7 @@ async function listIncidentsForAlert(client, alertConfigId, alertId) {
console.log(` status: ${incident.status}`);
console.log(` root dimension key: ${incident.rootDimensionKey}`);
console.log(` startTime: ${incident.startTime}`);
console.log(` last occured: ${incident.lastOccurredTime}`);
console.log(` last occurred: ${incident.lastOccurredTime}`);
console.log(` detection config id: ${incident.detectionConfigurationId}`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ async function updateDataFeed(client: MetricsAdvisorAdministrationClient, dataFe
const updated = await client.updateDataFeed(dataFeedId, patch);
console.dir(updated);
} catch (err) {
console.log("Error occured when updating data feed");
console.log("Error occurred when updating data feed");
console.log(err);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function listIncidentsForDetectionConfig(
console.log(` status: ${incident.status}`);
console.log(` root dimension key: ${incident.rootDimensionKey}`);
console.log(` startTime: ${incident.startTime}`);
console.log(` last occured: ${incident.lastOccurredTime}`);
console.log(` last occurred: ${incident.lastOccurredTime}`);
console.log(` detection config id: ${incident.detectionConfigurationId}`);
}

Expand Down Expand Up @@ -153,12 +153,7 @@ async function listAlerts(client: MetricsAdvisorClient, alertConfigId: string) {

console.log(` by pages`);
const iterator = client
.listAlerts(
alertConfigId,
new Date("11/01/2020"),
new Date("11/05/2020"),
"AnomalyTime"
)
.listAlerts(alertConfigId, new Date("11/01/2020"), new Date("11/05/2020"), "AnomalyTime")
.byPage({ maxPageSize: 20 });

let result = await iterator.next();
Expand Down Expand Up @@ -186,7 +181,7 @@ async function listIncidentsForAlert(
console.log(` status: ${incident.status}`);
console.log(` root dimension key: ${incident.rootDimensionKey}`);
console.log(` startTime: ${incident.startTime}`);
console.log(` last occured: ${incident.lastOccurredTime}`);
console.log(` last occurred: ${incident.lastOccurredTime}`);
console.log(` detection config id: ${incident.detectionConfigurationId}`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ async function configureAnomalyDetectionConfiguration(
},
description: "Detection configuration description"
};
return await adminClient.createMetricAnomalyDetectionConfiguration(anomalyConfig);
return await adminClient.createDetectionConfig(anomalyConfig);
}

async function createWebhookHook(adminClient: MetricsAdvisorAdministrationClient) {
Expand Down Expand Up @@ -230,7 +230,7 @@ async function configureAlertConfiguration(
hookIds,
description: "Alerting config description"
};
return await adminClient.createAnomalyAlertConfiguration(anomalyAlert);
return await adminClient.createAlertConfig(anomalyAlert);
}

async function queryAlerts(
Expand Down

0 comments on commit ae679b5

Please sign in to comment.