access log: runtime filter enhancements (#490)
1) Add ability to runtime filter to configure default, divisor, and whether independent randomness is used. 2) Also add LE to the comparison filter. Signed-off-by: Matt Klein <mklein@lyft.com>pull/518/head
parent
da0933c579
commit
e9c53c404b
16 changed files with 108 additions and 26 deletions
@ -1,8 +1,9 @@ |
|||||||
Types |
Types |
||||||
========= |
===== |
||||||
|
|
||||||
.. toctree:: |
.. toctree:: |
||||||
:glob: |
:glob: |
||||||
:maxdepth: 2 |
:maxdepth: 2 |
||||||
|
|
||||||
|
../type/percent.proto |
||||||
../type/range.proto |
../type/range.proto |
@ -0,0 +1,47 @@ |
|||||||
|
syntax = "proto3"; |
||||||
|
|
||||||
|
package envoy.type; |
||||||
|
|
||||||
|
import "google/protobuf/wrappers.proto"; |
||||||
|
|
||||||
|
import "validate/validate.proto"; |
||||||
|
|
||||||
|
// [#protodoc-title: Percent] |
||||||
|
|
||||||
|
// Identifies a percentage, in the range [0.0, 100.0]. |
||||||
|
message Percent { |
||||||
|
double value = 1 [(validate.rules).double = {gte: 0, lte: 100}]; |
||||||
|
} |
||||||
|
|
||||||
|
// A fractional percentage is used in cases in which for performance reasons performing floating |
||||||
|
// point to integer conversions during randomness calculations is undesirable. The message includes |
||||||
|
// both a numerator and denominator that together determine the final fractional value. |
||||||
|
// |
||||||
|
// * **Example**: 1/100 = 1%. |
||||||
|
// * **Example**: 3/10000 = 0.03%. |
||||||
|
message FractionalPercent { |
||||||
|
// Specifies the numerator. Defaults to 0. |
||||||
|
uint32 numerator = 1; |
||||||
|
|
||||||
|
// Fraction percentages support several fixed denominator values. |
||||||
|
enum DenominatorType { |
||||||
|
// 100. |
||||||
|
// |
||||||
|
// **Example**: 1/100 = 1%. |
||||||
|
HUNDRED = 0; |
||||||
|
|
||||||
|
// 10,000. |
||||||
|
// |
||||||
|
// **Example**: 1/10000 = 0.01%. |
||||||
|
TEN_THOUSAND = 1; |
||||||
|
|
||||||
|
// 1,000,000. |
||||||
|
// |
||||||
|
// **Example**: 1/1000000 = 0.0001%. |
||||||
|
MILLION = 2; |
||||||
|
} |
||||||
|
|
||||||
|
// Specifies the denominator. If the denominator specified is less than the numerator, the final |
||||||
|
// fractional percentage is capped at 1 (100%). |
||||||
|
DenominatorType denominator = 2 [(validate.rules).enum.defined_only = true]; |
||||||
|
} |
Loading…
Reference in new issue