Skip to content

Commit

Permalink
feat(spanner): add autoscaling config to the instance proto (#1935)
Browse files Browse the repository at this point in the history
* feat(spanner): add autoscaling config to the instance proto

PiperOrigin-RevId: 573098210

Source-Link: googleapis/googleapis@d6467db

Source-Link: googleapis/googleapis-gen@9ea8b73
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWVhOGI3MzQ1ZWYyZDkzYTQ5YjE1YTMzMmE2ODJhNjE3MTRmMDczZSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Oct 13, 2023
1 parent 7d0bde9 commit fe285c6
Show file tree
Hide file tree
Showing 4 changed files with 1,304 additions and 4 deletions.
Expand Up @@ -562,6 +562,66 @@ message InstanceConfig {
State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Autoscaling config for an instance.
message AutoscalingConfig {
// The autoscaling limits for the instance. Users can define the minimum and
// maximum compute capacity allocated to the instance, and the autoscaler will
// only scale within that range. Users can either use nodes or processing
// units to specify the limits, but should use the same unit to set both the
// min_limit and max_limit.
message AutoscalingLimits {
// The minimum compute capacity for the instance.
oneof min_limit {
// Minimum number of nodes allocated to the instance. If set, this number
// should be greater than or equal to 1.
int32 min_nodes = 1;

// Minimum number of processing units allocated to the instance. If set,
// this number should be multiples of 1000.
int32 min_processing_units = 2;
}

// The maximum compute capacity for the instance. The maximum compute
// capacity should be less than or equal to 10X the minimum compute
// capacity.
oneof max_limit {
// Maximum number of nodes allocated to the instance. If set, this number
// should be greater than or equal to min_nodes.
int32 max_nodes = 3;

// Maximum number of processing units allocated to the instance. If set,
// this number should be multiples of 1000 and be greater than or equal to
// min_processing_units.
int32 max_processing_units = 4;
}
}

// The autoscaling targets for an instance.
message AutoscalingTargets {
// Required. The target high priority cpu utilization percentage that the
// autoscaler should be trying to achieve for the instance. This number is
// on a scale from 0 (no utilization) to 100 (full utilization). The valid
// range is [10, 90] inclusive.
int32 high_priority_cpu_utilization_percent = 1
[(google.api.field_behavior) = REQUIRED];

// Required. The target storage utilization percentage that the autoscaler
// should be trying to achieve for the instance. This number is on a scale
// from 0 (no utilization) to 100 (full utilization). The valid range is
// [10, 100] inclusive.
int32 storage_utilization_percent = 2
[(google.api.field_behavior) = REQUIRED];
}

// Required. Autoscaling limits for an instance.
AutoscalingLimits autoscaling_limits = 1
[(google.api.field_behavior) = REQUIRED];

// Required. The autoscaling targets for an instance.
AutoscalingTargets autoscaling_targets = 2
[(google.api.field_behavior) = REQUIRED];
}

// An isolated set of Cloud Spanner resources on which databases can be hosted.
message Instance {
option (google.api.resource) = {
Expand Down Expand Up @@ -606,8 +666,12 @@ message Instance {
string display_name = 3 [(google.api.field_behavior) = REQUIRED];

// The number of nodes allocated to this instance. At most one of either
// node_count or processing_units should be present in the message. This
// may be zero in API responses for instances that are not yet in state
// node_count or processing_units should be present in the message.
//
// Users can set the node_count field to specify the target number of nodes
// allocated to the instance.
//
// This may be zero in API responses for instances that are not yet in state
// `READY`.
//
// See [the
Expand All @@ -616,14 +680,26 @@ message Instance {
int32 node_count = 5;

// The number of processing units allocated to this instance. At most one of
// processing_units or node_count should be present in the message. This may
// be zero in API responses for instances that are not yet in state `READY`.
// processing_units or node_count should be present in the message.
//
// Users can set the processing_units field to specify the target number of
// processing units allocated to the instance.
//
// This may be zero in API responses for instances that are not yet in state
// `READY`.
//
// See [the
// documentation](https://cloud.google.com/spanner/docs/compute-capacity)
// for more information about nodes and processing units.
int32 processing_units = 9;

// Optional. The autoscaling configuration. Autoscaling is enabled if this
// field is set. When autoscaling is enabled, node_count and processing_units
// are treated as OUTPUT_ONLY fields and reflect the current compute capacity
// allocated to the instance.
AutoscalingConfig autoscaling_config = 17
[(google.api.field_behavior) = OPTIONAL];

// Output only. The current instance state. For
// [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance],
// the state must be either omitted or set to `CREATING`. For
Expand Down

0 comments on commit fe285c6

Please sign in to comment.