turbot/aws_insights

Query: redshift_cluster_by_cpu_utilization_category

Usage

powerpipe query aws_insights.query.redshift_cluster_by_cpu_utilization_category

SQL

with cpu_buckets as (
select
unnest(array ['Unused (<1%)','Underutilized (1-10%)','Right-sized (10-90%)', 'Overutilized (>90%)' ]) as cpu_bucket
),
max_averages as (
select
cluster_identifier,
case
when max(average) <= 1 then 'Unused (<1%)'
when max(average) between 1 and 10 then 'Underutilized (1-10%)'
when max(average) between 10 and 90 then 'Right-sized (10-90%)'
when max(average) > 90 then 'Overutilized (>90%)'
end as cpu_bucket,
max(average) as max_avg
from
aws_redshift_cluster_metric_cpu_utilization_daily
where
date_part('day', now() - timestamp) <= 30
group by
cluster_identifier
)
select
b.cpu_bucket as "CPU Utilization",
count(a.*)
from
cpu_buckets as b
left join max_averages as a on b.cpu_bucket = a.cpu_bucket
group by
b.cpu_bucket;

Dashboards

The query is used in the dashboards: