Skip to content

Commit 3326fa2

Browse files
author
Eugene Cheung
authored
fix(MetricFactory): more specific return type for createMetricSearch (#584)
Fixes #583 Also includes minor README fixes noted in that issue. --- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
1 parent 3c5ec1b commit 3326fa2

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

API.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ Multiple metrics cannot be rendered with anomaly detection in a single widget du
202202
```ts
203203
monitorCustom({
204204
title: "Metric with anomaly detection",
205-
metrics: [
205+
metricGroups: [
206206
{
207207
metric: m1,
208208
anomalyDetectionStandardDeviationToRender: 3
@@ -216,7 +216,7 @@ Adding an alarm:
216216
```ts
217217
monitorCustom({
218218
title: "Metric with anomaly detection and alarm",
219-
metrics: [
219+
metricGroups: [
220220
{
221221
metric: m1,
222222
alarmFriendlyName: "MetricWithAnomalyDetectionAlarm",
@@ -238,7 +238,7 @@ monitorCustom({
238238
```ts
239239
monitorCustom({
240240
title: "Metric search",
241-
metrics: [
241+
metricGroups: [
242242
{
243243
searchQuery: "My.Prefix.",
244244
dimensionsMap: {

lib/common/metric/MetricFactory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export class MetricFactory {
146146
period?: Duration,
147147
region?: string,
148148
account?: string,
149-
): IMetric {
149+
): MathExpression {
150150
const finalPeriod =
151151
period ?? this.globalDefaults.period ?? DefaultMetricPeriod;
152152
const searchNamespace = this.getNamespaceWithFallback(namespace);

0 commit comments

Comments
 (0)