Skip to content

Commit

Permalink
Fix queuetime expression
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleung-appzen committed Aug 27, 2020
1 parent 0dfb799 commit 3c5868c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,15 @@ resource "aws_cloudwatch_metric_alarm" "queue_time" {
# Requires ECS ContainerInsights to be enabled: aws ecs update-cluster-settings --cluster <cluster name> --settings name=containerInsights,value=enabled
# ECS cluster name and service name

alarm_name = "${module.label.id}-sqs-big-up"
alarm_name = "${module.label.id}-sqs-queuetime-up"
alarm_description = "Alarm monitors ${var.queue_name} QueueTime = ((Queue Size * Worker Timing) / (number of current tasks * Number Of workers per task))"
comparison_operator = "GreaterThanThreshold"
evaluation_periods = "1"
threshold = "${var.queue_time_threshold}"
alarm_actions = ["${aws_appautoscaling_policy.scale_queuetime_up.arn}"]
metric_query {
id = "queuetime"
expression = "((visible+notvisible) * ${var.queue_worker_timing}) / (taskcount * ${var.queue_task_worker_count}))"
expression = "((visible+notvisible) * ${var.queue_worker_timing}) / (taskcount * ${var.queue_task_worker_count})"
label = "WaitTime"
return_data = "true"
}
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ variable "queue_worker_timing" {

variable "queue_task_worker_count" {
description = "number of Workers per Task in calculation queue_time_threshold"
default = "1"
default = "4"
}

variable "scale_down_cooldown" {
Expand Down

0 comments on commit 3c5868c

Please sign in to comment.