HierarchicalDrrSettings.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_rate_limiter.proto
  4. namespace Ydb\RateLimiter;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * Settings for hierarchical deficit round robin (HDRR) algorithm.
  10. *
  11. * Generated from protobuf message <code>Ydb.RateLimiter.HierarchicalDrrSettings</code>
  12. */
  13. class HierarchicalDrrSettings extends \Google\Protobuf\Internal\Message
  14. {
  15. /**
  16. * Resource consumption speed limit.
  17. * Value is required for root resource.
  18. * 0 is equivalent to not set.
  19. * Must be nonnegative.
  20. *
  21. * Generated from protobuf field <code>double max_units_per_second = 1;</code>
  22. */
  23. protected $max_units_per_second = 0.0;
  24. /**
  25. * Maximum burst size of resource consumption across the whole cluster
  26. * divided by max_units_per_second.
  27. * Default value is 1.
  28. * This means that maximum burst size might be equal to max_units_per_second.
  29. * 0 is equivalent to not set.
  30. * Must be nonnegative.
  31. *
  32. * Generated from protobuf field <code>double max_burst_size_coefficient = 2;</code>
  33. */
  34. protected $max_burst_size_coefficient = 0.0;
  35. /**
  36. * Prefetch in local bucket up to prefetch_coefficient*max_units_per_second units (full size).
  37. * Default value is inherited from parent or 0.2 for root.
  38. * Disables prefetching if any negative value is set
  39. * (It is useful to avoid bursts in case of large number of local buckets).
  40. *
  41. * Generated from protobuf field <code>double prefetch_coefficient = 3;</code>
  42. */
  43. protected $prefetch_coefficient = 0.0;
  44. /**
  45. * Prefetching starts if there is less than prefetch_watermark fraction of full local bucket left.
  46. * Default value is inherited from parent or 0.75 for root.
  47. * Must be nonnegative and less than or equal to 1.
  48. *
  49. * Generated from protobuf field <code>double prefetch_watermark = 4;</code>
  50. */
  51. protected $prefetch_watermark = 0.0;
  52. /**
  53. * Constructor.
  54. *
  55. * @param array $data {
  56. * Optional. Data for populating the Message object.
  57. *
  58. * @type float $max_units_per_second
  59. * Resource consumption speed limit.
  60. * Value is required for root resource.
  61. * 0 is equivalent to not set.
  62. * Must be nonnegative.
  63. * @type float $max_burst_size_coefficient
  64. * Maximum burst size of resource consumption across the whole cluster
  65. * divided by max_units_per_second.
  66. * Default value is 1.
  67. * This means that maximum burst size might be equal to max_units_per_second.
  68. * 0 is equivalent to not set.
  69. * Must be nonnegative.
  70. * @type float $prefetch_coefficient
  71. * Prefetch in local bucket up to prefetch_coefficient*max_units_per_second units (full size).
  72. * Default value is inherited from parent or 0.2 for root.
  73. * Disables prefetching if any negative value is set
  74. * (It is useful to avoid bursts in case of large number of local buckets).
  75. * @type float $prefetch_watermark
  76. * Prefetching starts if there is less than prefetch_watermark fraction of full local bucket left.
  77. * Default value is inherited from parent or 0.75 for root.
  78. * Must be nonnegative and less than or equal to 1.
  79. * }
  80. */
  81. public function __construct($data = NULL) {
  82. \GPBMetadata\Protos\YdbRateLimiter::initOnce();
  83. parent::__construct($data);
  84. }
  85. /**
  86. * Resource consumption speed limit.
  87. * Value is required for root resource.
  88. * 0 is equivalent to not set.
  89. * Must be nonnegative.
  90. *
  91. * Generated from protobuf field <code>double max_units_per_second = 1;</code>
  92. * @return float
  93. */
  94. public function getMaxUnitsPerSecond()
  95. {
  96. return $this->max_units_per_second;
  97. }
  98. /**
  99. * Resource consumption speed limit.
  100. * Value is required for root resource.
  101. * 0 is equivalent to not set.
  102. * Must be nonnegative.
  103. *
  104. * Generated from protobuf field <code>double max_units_per_second = 1;</code>
  105. * @param float $var
  106. * @return $this
  107. */
  108. public function setMaxUnitsPerSecond($var)
  109. {
  110. GPBUtil::checkDouble($var);
  111. $this->max_units_per_second = $var;
  112. return $this;
  113. }
  114. /**
  115. * Maximum burst size of resource consumption across the whole cluster
  116. * divided by max_units_per_second.
  117. * Default value is 1.
  118. * This means that maximum burst size might be equal to max_units_per_second.
  119. * 0 is equivalent to not set.
  120. * Must be nonnegative.
  121. *
  122. * Generated from protobuf field <code>double max_burst_size_coefficient = 2;</code>
  123. * @return float
  124. */
  125. public function getMaxBurstSizeCoefficient()
  126. {
  127. return $this->max_burst_size_coefficient;
  128. }
  129. /**
  130. * Maximum burst size of resource consumption across the whole cluster
  131. * divided by max_units_per_second.
  132. * Default value is 1.
  133. * This means that maximum burst size might be equal to max_units_per_second.
  134. * 0 is equivalent to not set.
  135. * Must be nonnegative.
  136. *
  137. * Generated from protobuf field <code>double max_burst_size_coefficient = 2;</code>
  138. * @param float $var
  139. * @return $this
  140. */
  141. public function setMaxBurstSizeCoefficient($var)
  142. {
  143. GPBUtil::checkDouble($var);
  144. $this->max_burst_size_coefficient = $var;
  145. return $this;
  146. }
  147. /**
  148. * Prefetch in local bucket up to prefetch_coefficient*max_units_per_second units (full size).
  149. * Default value is inherited from parent or 0.2 for root.
  150. * Disables prefetching if any negative value is set
  151. * (It is useful to avoid bursts in case of large number of local buckets).
  152. *
  153. * Generated from protobuf field <code>double prefetch_coefficient = 3;</code>
  154. * @return float
  155. */
  156. public function getPrefetchCoefficient()
  157. {
  158. return $this->prefetch_coefficient;
  159. }
  160. /**
  161. * Prefetch in local bucket up to prefetch_coefficient*max_units_per_second units (full size).
  162. * Default value is inherited from parent or 0.2 for root.
  163. * Disables prefetching if any negative value is set
  164. * (It is useful to avoid bursts in case of large number of local buckets).
  165. *
  166. * Generated from protobuf field <code>double prefetch_coefficient = 3;</code>
  167. * @param float $var
  168. * @return $this
  169. */
  170. public function setPrefetchCoefficient($var)
  171. {
  172. GPBUtil::checkDouble($var);
  173. $this->prefetch_coefficient = $var;
  174. return $this;
  175. }
  176. /**
  177. * Prefetching starts if there is less than prefetch_watermark fraction of full local bucket left.
  178. * Default value is inherited from parent or 0.75 for root.
  179. * Must be nonnegative and less than or equal to 1.
  180. *
  181. * Generated from protobuf field <code>double prefetch_watermark = 4;</code>
  182. * @return float
  183. */
  184. public function getPrefetchWatermark()
  185. {
  186. return $this->prefetch_watermark;
  187. }
  188. /**
  189. * Prefetching starts if there is less than prefetch_watermark fraction of full local bucket left.
  190. * Default value is inherited from parent or 0.75 for root.
  191. * Must be nonnegative and less than or equal to 1.
  192. *
  193. * Generated from protobuf field <code>double prefetch_watermark = 4;</code>
  194. * @param float $var
  195. * @return $this
  196. */
  197. public function setPrefetchWatermark($var)
  198. {
  199. GPBUtil::checkDouble($var);
  200. $this->prefetch_watermark = $var;
  201. return $this;
  202. }
  203. }