exemptprioritylevelconfiguration.go 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // Code generated by applyconfiguration-gen. DO NOT EDIT.
  14. package v1beta2
  15. // ExemptPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the ExemptPriorityLevelConfiguration type for use
  16. // with apply.
  17. //
  18. // ExemptPriorityLevelConfiguration describes the configurable aspects
  19. // of the handling of exempt requests.
  20. // In the mandatory exempt configuration object the values in the fields
  21. // here can be modified by authorized users, unlike the rest of the `spec`.
  22. type ExemptPriorityLevelConfigurationApplyConfiguration struct {
  23. // `nominalConcurrencyShares` (NCS) contributes to the computation of the
  24. // NominalConcurrencyLimit (NominalCL) of this level.
  25. // This is the number of execution seats nominally reserved for this priority level.
  26. // This DOES NOT limit the dispatching from this priority level
  27. // but affects the other priority levels through the borrowing mechanism.
  28. // The server's concurrency limit (ServerCL) is divided among all the
  29. // priority levels in proportion to their NCS values:
  30. //
  31. // NominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs )
  32. // sum_ncs = sum[priority level k] NCS(k)
  33. //
  34. // Bigger numbers mean a larger nominal concurrency limit,
  35. // at the expense of every other priority level.
  36. // This field has a default value of zero.
  37. NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"`
  38. // `lendablePercent` prescribes the fraction of the level's NominalCL that
  39. // can be borrowed by other priority levels. This value of this
  40. // field must be between 0 and 100, inclusive, and it defaults to 0.
  41. // The number of seats that other levels can borrow from this level, known
  42. // as this level's LendableConcurrencyLimit (LendableCL), is defined as follows.
  43. //
  44. // LendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )
  45. LendablePercent *int32 `json:"lendablePercent,omitempty"`
  46. }
  47. // ExemptPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the ExemptPriorityLevelConfiguration type for use with
  48. // apply.
  49. func ExemptPriorityLevelConfiguration() *ExemptPriorityLevelConfigurationApplyConfiguration {
  50. return &ExemptPriorityLevelConfigurationApplyConfiguration{}
  51. }
  52. // WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value
  53. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  54. // If called multiple times, the NominalConcurrencyShares field is set to the value of the last call.
  55. func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration {
  56. b.NominalConcurrencyShares = &value
  57. return b
  58. }
  59. // WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value
  60. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  61. // If called multiple times, the LendablePercent field is set to the value of the last call.
  62. func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration {
  63. b.LendablePercent = &value
  64. return b
  65. }