davsclaus opened a new pull request, #29396:
URL: https://github.com/apache/camel/pull/29396

   ## Description
   
   [CAMEL-26726](https://issues.apache.org/jira/browse/CAMEL-26726): W-8 of the 
stage 2 decisions on CAMEL-26607, expectations on time and loss. The delay 
recipes had nothing to check, and "nothing was lost between two routes" is the 
question people ask.
   
   | Expectation | Is met when |
   |---|---|
   | `expect=orders:meanTime<=2s` | the mean time of the exchanges in route 
`orders` is at most 2 s when the time is up |
   | `expect=orders:maxTime<=5s` | no exchange of `orders` took longer than 5 s 
(one that does makes it unmet at once) |
   | `expect=orders->shipping:lost<=0` (or `lost=0`) | every message completed 
in `orders` also completed in `shipping` by the time it is up |
   
   - The time of an exchange in a route is measured by chaos: the route policy 
notes when an exchange enters a route that has a time expectation, and 
`routeDone` records the time the first time the route is done with it 
(completed, handled or failed), redeliveries included. It is read through 
`TimeSource`, so it is virtual time in a simulation test. Ops `<=` and `>=`; a 
time of no exchange is unmet.
   - A loss counts the completed exchanges of both routes until the time is up; 
the difference (never below 0) is the messages lost, which also count in the 
report's `lost`. Ops `<=` and `=`. The docs say to let `within=` run past the 
faults, so the last messages can arrive.
   - Refused with a reason: `meanTime=`, `lost>=`, `lost` without two routes, 
two routes without `lost`, the same route twice.
   - The report: the reason (`route orders: max 3s of 3 exchanges within 1m0s, 
at most 1s expected (rule r1)`, `routes orders->ship: 2 lost (4 completed in 
orders, 2 in ship) within 1m0s, at most 0 expected (rule r1): 2 lost`), the 
text line (`mean 1s500ms of 4 exchanges`), and in JSON `spec`, `toRoute` and 
`samples`. The rule in plain words (`expects a mean time of at most 2 seconds 
in route orders`, `expects no message lost between route orders and route 
ship`), the chaos model (each kind now has a description; catalog copy 
updated), `camel get chaos` and the chaos screen show the spec and a time as a 
time.
   - No `p99`: the route statistics have no percentiles.
   
   Docs: new section "Expectations on time and loss" of the camel-chaos page, 
the rule syntax block, `design/chaos.adoc`.
   
   ## Tests
   
   - `ChaosExpectTimeAndLossTest` (virtual clock): mean time met when the time 
is up, one slow exchange fails max time at once, a time of no exchange is 
unmet, messages lost between two routes (FAIL, lost in the report), nothing 
lost, the example of the docs, the refused forms.
   - camel-chaos: 776 green (one parser test used `lost` as an unknown kind; it 
is a kind now).
   - `ListChaosTest` 18, TUI chaos tests 53 green.
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to