elastic / elastic-integration-corpus-generator-tool

Command line tool used for generating events corpus dynamically given a specific integration
Other
21 stars 12 forks source link

support weighted enums #130

Open tommyers-elastic opened 7 months ago

tommyers-elastic commented 7 months ago

there are a few cases where we want enums with particular weights, and the only way to achieve this currently is by using repetition. (e.g. https://github.com/elastic/integrations/pull/8442/files#r1389790022)

e.g.

["50", "50", "50", "50", "50", "30", "30", "30", "20", "20"] 

a possible notation for this would be a weighting config field, which would be an ordered list with the same length as the enum, where the sum of the values is 1.

e.g.

name: number
    enum: ["50", "30", "20"]
    weights: [0.5, 0.3, 0.2]