-
Notifications
You must be signed in to change notification settings - Fork 234
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
Support keyword found/not found for HTTP probe #76
Comments
I'd to define the correct behavior here. @DannyBen please help to review. We need to check the HTTP Status Code and the response keyword. the flowing table show all senarios.
|
Yup. Sounds about right. |
Sorry, I updated the case study table. if the success keywords are not matched, we should consider it failed. So, there is only one scenario that is considered a SUCCESS ✅
Meanwhile, for the first version, only checks the whole string instead of each word in the |
Ok. Actually the table confused me a little, it is easy to make mistakes when reviewing it. I see it as: # pseudocode
status = "success"
status = "failed" if expected_http_codes configured and response_http_code is not in expected_http_codes
status = "failed" if success_keywords configured and success_keywords is not in response_body
status = "failed" if failure_keywords configured and failure_keywords is in response_body
return status |
In my view - if the If it is easier to avoid the array, I think it is fine to just have a single string. Most monitors I know are providing just that. |
The cases you mentioned are no problem. But we need to understand this feature introduces complications - because there are 3 factors, and they might conflict. For examples:
That's why I give a table to do all cases study. |
I understand, and my pseudocode shows that we assume success first, and ANY condition not met means failure. In my code, when I saw I updated the pseudocode, but if I understand correctly, we say the same thing. Any condition - if configured by the user - means failure if it is not met. In other words, I see the table like this (assuming all three are configured by the user)
|
I think that the pseudo code described by @DannyBen covers your cases as well @haoel
Based on the pseudocode this case is indeed returning failure as you say, the fail will be raised by the 3rd check
This will raise a failure by the 2nd check
I think the logic described by the pseudocode is sound. PS: I also got confused by the table 😄 |
Yes. We have a different way but the same destination. (Personally, I like to figure out all permutations to make sure no case is missed) BTW, The current code implementation is exactly the same as the pseudocode logic with three checks. ;-) |
close this issue as PR #80 merged. feel free to reopen it if have further questions. |
When using http probing, it is common to check for the existence or absence of a keyword. I would love to have such a feature in easeprobe.
Implementation suggestion:
The text was updated successfully, but these errors were encountered: