Skip to content

Commit

Permalink
Commit API.md, whitespace changes to docstrings and test snap updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Aneesh Shukla committed Oct 20, 2023
1 parent f8c69b5 commit 5199fe7
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 17 deletions.
115 changes: 110 additions & 5 deletions API.md

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

Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class ElastiCacheClusterMetricFactory {
/**
* Because Redis is single-threaded, you can use this metric to analyze the load of the Redis process itself.
* Note that you may want to monitor both Engine CPU Utilization as well as CPU Utilization as background
* processes can take up a significant portion of the CPU workload. This is especially important for
* processes can take up a significant portion of the CPU workload. This is especially important for
* hosts with 2 vCPUs or less.
*
* @see https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheMetrics.Redis.html
Expand Down
11 changes: 8 additions & 3 deletions lib/monitoring/aws-elasticache/ElastiCacheClusterMonitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface ElastiCacheClusterMonitoringOptions
/**
* Add Redis engine CPU usage alarm.
*
* It is recommended to monitor CPU utilization with `addCpuUsageAlarm`
* It is recommended to monitor CPU utilization with `addCpuUsageAlarm`
* as well for hosts with two vCPUs or less.
*/
readonly addRedisEngineCpuUsageAlarm?: Record<string, UsageThreshold>;
Expand Down Expand Up @@ -176,8 +176,13 @@ export class ElastiCacheClusterMonitoring extends Monitoring {
this.addAlarm(createdAlarm);
}

if (props.addRedisEngineCpuUsageAlarm !== undefined && props.clusterType !== ElastiCacheClusterType.REDIS) {
throw new Error("It is only possible to alarm on Redis Engine CPU Usage for Redis clusters")
if (
props.addRedisEngineCpuUsageAlarm !== undefined &&
props.clusterType !== ElastiCacheClusterType.REDIS
) {
throw new Error(
"It is only possible to alarm on Redis Engine CPU Usage for Redis clusters"
);
}

for (const disambiguator in props.addRedisEngineCpuUsageAlarm) {
Expand Down
Loading

0 comments on commit 5199fe7

Please sign in to comment.