Skip to content

Commit

Permalink
feat(serverless): add option to scale on memory usage (scaleway#2296)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Nov 5, 2024
1 parent 7cd49c9 commit 807ee11
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions api/container/v1beta1/container_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -792,11 +792,14 @@ type ContainerHealthCheckSpec struct {

// ContainerScalingOption: container scaling option.
type ContainerScalingOption struct {
// Precisely one of ConcurrentRequestsThreshold, CPUUsageThreshold must be set.
// Precisely one of ConcurrentRequestsThreshold, CPUUsageThreshold, MemoryUsageThreshold must be set.
ConcurrentRequestsThreshold *uint32 `json:"concurrent_requests_threshold,omitempty"`

// Precisely one of ConcurrentRequestsThreshold, CPUUsageThreshold must be set.
// Precisely one of ConcurrentRequestsThreshold, CPUUsageThreshold, MemoryUsageThreshold must be set.
CPUUsageThreshold *uint32 `json:"cpu_usage_threshold,omitempty"`

// Precisely one of ConcurrentRequestsThreshold, CPUUsageThreshold, MemoryUsageThreshold must be set.
MemoryUsageThreshold *uint32 `json:"memory_usage_threshold,omitempty"`
}

// SecretHashedValue: secret hashed value.
Expand Down Expand Up @@ -973,6 +976,7 @@ type Container struct {
// ScalingOption: possible values:
// - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance.
// - cpu_usage_threshold: Scale depending on the CPU usage of a container instance.
// - memory_usage_threshold: Scale depending on the memory usage of a container instance.
ScalingOption *ContainerScalingOption `json:"scaling_option"`

// HealthCheck: health check configuration of the container.
Expand Down Expand Up @@ -1221,6 +1225,7 @@ type CreateContainerRequest struct {
// ScalingOption: possible values:
// - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance.
// - cpu_usage_threshold: Scale depending on the CPU usage of a container instance.
// - memory_usage_threshold: Scale depending on the memory usage of a container instance.
ScalingOption *ContainerScalingOption `json:"scaling_option,omitempty"`

// HealthCheck: health check configuration of the container.
Expand Down Expand Up @@ -1817,6 +1822,7 @@ type UpdateContainerRequest struct {
// ScalingOption: possible values:
// - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance.
// - cpu_usage_threshold: Scale depending on the CPU usage of a container instance.
// - memory_usage_threshold: Scale depending on the memory usage of a container instance.
ScalingOption *ContainerScalingOption `json:"scaling_option,omitempty"`

// HealthCheck: health check configuration of the container.
Expand Down

0 comments on commit 807ee11

Please sign in to comment.