Skip to content

Commit

Permalink
feat: added wallet gate0 scaling profile
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-calabrese committed Oct 14, 2024
1 parent 9ecc9c0 commit 86d1eff
Showing 1 changed file with 104 additions and 0 deletions.
104 changes: 104 additions & 0 deletions src/domains/functions/function_services.tf
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,110 @@ resource "azurerm_monitor_autoscale_setting" "function_services_autoscale" {
}
}
}

profile {
name = "wallet_gate0"

capacity {
minimum = 8
maximum = 30
default = 10
}

fixed_date {
timezone = "W. Europe Standard Time"
start = "2024-10-15T08:00:00.000Z"
end = "2024-10-15T23:30:00.000Z"
}

rule {
metric_trigger {
metric_name = "Requests"
metric_resource_id = module.function_services[count.index].id
metric_namespace = "microsoft.web/sites"
time_grain = "PT1M"
statistic = "Max"
time_window = "PT1M"
time_aggregation = "Maximum"
operator = "GreaterThan"
threshold = 3000
divide_by_instance_count = true
}

scale_action {
direction = "Increase"
type = "ChangeCount"
value = "2"
cooldown = "PT1M"
}
}

rule {
metric_trigger {
metric_name = "CpuPercentage"
metric_resource_id = module.function_services[count.index].app_service_plan_id
metric_namespace = "microsoft.web/serverfarms"
time_grain = "PT1M"
statistic = "Max"
time_window = "PT1M"
time_aggregation = "Maximum"
operator = "GreaterThan"
threshold = 40
divide_by_instance_count = false
}

scale_action {
direction = "Increase"
type = "ChangeCount"
value = "3"
cooldown = "PT2M"
}
}

rule {
metric_trigger {
metric_name = "Requests"
metric_resource_id = module.function_services[count.index].id
metric_namespace = "microsoft.web/sites"
time_grain = "PT1M"
statistic = "Average"
time_window = "PT5M"
time_aggregation = "Average"
operator = "LessThan"
threshold = 300
divide_by_instance_count = true
}

scale_action {
direction = "Decrease"
type = "ChangeCount"
value = "1"
cooldown = "PT1M"
}
}

rule {
metric_trigger {
metric_name = "CpuPercentage"
metric_resource_id = module.function_services[count.index].app_service_plan_id
metric_namespace = "microsoft.web/serverfarms"
time_grain = "PT1M"
statistic = "Average"
time_window = "PT5M"
time_aggregation = "Average"
operator = "LessThan"
threshold = 15
divide_by_instance_count = false
}

scale_action {
direction = "Decrease"
type = "ChangeCount"
value = "1"
cooldown = "PT2M"
}
}
}
}

# Cosmos container for subscription cidrs
Expand Down

0 comments on commit 86d1eff

Please sign in to comment.