Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added inject function #143

Merged
merged 1 commit into from
Jul 17, 2024
Merged

Added inject function #143

merged 1 commit into from
Jul 17, 2024

Conversation

enrichman
Copy link
Contributor

@enrichman enrichman commented Jul 16, 2024

Fixes #142


This PR adds an inject function that will override the original value if the percentage matches.

A 1 value means "always inject", while the 0 is "never".

A 0.5 will match with a probability of 50%.

-> % jr template run --embedded '{{city | inject 0.5 "<FAIL>" }}'
2024/07/16 22:55:49 JR configuration not found
<FAIL>

Elapsed time: 0s
Data Generated (Objects): 1
Data Generated (bytes): 6
Throughput (bytes per second):        49

-> % jr template run --embedded '{{city | inject 0.5 "<FAIL>" }}'
2024/07/16 22:55:51 JR configuration not found
Houston

Elapsed time: 0s
Data Generated (Objects): 1
Data Generated (bytes): 7
Throughput (bytes per second):        58

@enrichman enrichman changed the title [WIP] Added inject Added inject function Jul 17, 2024
@enrichman enrichman marked this pull request as ready for review July 17, 2024 06:27
@ugol ugol merged commit e5b17be into jrnd-io:main Jul 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inject faults in generated output
2 participants