Skip to content

Commit

Permalink
update unsupported MathExpression exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
miloszwatroba committed Nov 10, 2023
1 parent ccb010b commit eabe6ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions lib/common/alarm/AlarmFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ export interface AddAlarmProps {
* </ul>
* The newly created composite alarm will be returned as a result, and it will take the original alarm actions.
* @default - default behaviour - no condition on sample count will be added to the alarm
* @deprecated Use minMetricSampleCountToAlarm instead. minMetricSamplesAlarm uses different evaluation period
* for its child alarms, so it doesn't guarantee that each datapoint in the evaluation period has sufficient
* number of samples
* @deprecated Use minSampleCountToEvaluateDatapoint instead. minMetricSamplesAlarm uses different evaluation
* period for its child alarms, so it doesn't guarantee that each datapoint in the evaluation period has
* sufficient number of samples
*/
readonly minMetricSamplesToAlarm?: number;

Expand Down Expand Up @@ -573,7 +573,9 @@ export class AlarmFactory {
if (props.minSampleCountToEvaluateDatapoint) {
if (adjustedMetric instanceof MathExpression) {
throw new Error(
"minSampleCountToEvaluateDatapoint is not supported for MathExpressions"
"minSampleCountToEvaluateDatapoint is not supported for MathExpressions. " +
"If you already use MathExpression, you can extend your expression to evaluate " +
"the sample count using IF statement, e.g. IF(sampleCount > X, mathExpression)."
);
}

Expand Down

0 comments on commit eabe6ed

Please sign in to comment.