Comments (7)
Hey,
Indeed, the basic tolerance with a sequence like this one cannot handle the returned body from a HTTP probe. The reason is that such probe returns an object (a mapping) such as:
{
"status": 200,
"headers": {...},
"body": "..."
}
Here, the default tolerance range will look at the status, not the actual body.
To support this, we actually need a more complex new tolerance type, following the principles of the jsonpath and regex tolerances.
"tolerance": {
"type": "range",
"target": "body",
"range": {
"min": 10,
"max": 1000
}
}
When the body is a string, this can be reduced to:
"tolerance": {
"type": "range",
"target": "body",
"range": ["good", "better", "best"]
}
assuming:
{
"status": 200,
"headers": {...},
"body": "bad"
}
Please have a look #84 and see if it helps?
from chaostoolkit-lib.
While discussing with @GerardMoscardo, I wondered if it wasn't confusing to have "range": ["good", "better", "best"]
? Indeed, this could be achieved with a simple regex already. Maybe the range, should really stick to numerical values between low and high?
from chaostoolkit-lib.
Hello, IMO, as u said, range should be only used for numerical values.
from chaostoolkit-lib.
I agree.
In that case, should we use a shorter syntax:
"tolerance": {
"type": "range",
"target": "body",
"range": [-10, 10]
}
Basically, low/high and the value must between those boundaries.
from chaostoolkit-lib.
This looks perfect, also shares syntax with the other probes already existing:
A sequence tolerance with lower and upper bounds:
"tolerance": [4, 9]
Thanks!
from chaostoolkit-lib.
Exactly!
I'll update the PR asap.
from chaostoolkit-lib.
Documented in chaostoolkit/chaostoolkit-documentation@c8a58f7
from chaostoolkit-lib.
Related Issues (20)
- Move from setup.py to setup.cfg
- Moving to pylama
- Secrets should allow for arbitrary levels of nesting HOT 3
- Secrets testing taking advantage of side effect HOT 1
- What is intended behavior when secrets stored in a vault are overridden? HOT 3
- If a vault fails to load, should it raise an exception? HOT 2
- Dynamic configuration values HOT 11
- Invalid name reported in logs on Python provider validation
- chao run is failing to run "got an unexpected keyword argument 'continous_hypothesis_frequency'" HOT 3
- Whenever using settings.yaml file, before and after activity control called only from 1 control. HOT 6
- after_activity_control state.status is "succeeded" but probe tolerance wasn't met HOT 2
- Use dynamic config more then once, use the dynamic config as an argument to some other dynamic config doesn't working
- Experiment level controls not applied to activity when control declared on activity
- Fix dynamic config and env type config when using them in extra_vars HOT 18
- Load experiment configuration context from files even if not defined in experiment template HOT 3
- Status should be `completed` when all tolerances executed fine but tolerance wasn't matched HOT 1
- Loading var files without an extension fails
- Allow configuration substitution on jsonpath expect HOT 2
- Error in python 3.11 HOT 1
- Enhance Experiment Logs to Include Detailed ImportError Information
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chaostoolkit-lib.