I've got 3 different product types of agent, which each go it's individual path within the fabric. How can i measure the average time the product type spends in the system?
My logic looks like this , and i wanted to implement the measurement in the first service, like this:
, it will be completed in the last service like this :
Now I get some really high numbers, which are absolutely wrong. The process itself works fine, if you run the measurement with the code "//agent.enteredSystemP1 = time()", you will get a mean of 24 minutes, per product. But how can i get the mean per product type?
Asked
Active
Viewed 55 times
0

TimFabregas
- 17
- 2
1 Answers
1
Just use the same if-elseif-else distinction in the 2nd service block as well.
Currently, any agent leaving the system adds time to any systemTimeDistribution

Benjamin
- 10,603
- 3
- 16
- 28
-
you mean in the serviceV block at the end? i did try it, but this doesn't solve my problem.. – TimFabregas Jan 27 '23 at 08:29
-
Well, do you change the `systemTimeDistr...` variables anywhere else? Hard to help without more info. Try to simplify, test with 1 agent, 10, 1 type, 2 types... You need to find the root cause :) – Benjamin Jan 27 '23 at 08:59
-
No I only used them in the first and last service block. The problem is, if i only do agent.enteredSystem = time() in the first block; and add (time() - agent.enteredSystem) to the systemTimeDistribution in the last service block, i get the expected meantime of the overall production of the agent, without the separation in it's products "P1", "P2", "P3" - if i try to differentiate these in my if else block it seem's to sum up all these agents... – TimFabregas Jan 27 '23 at 09:24
-
It should not if you use the if-else in the last block. Hence: start playing Sherlock Holmes. Build a simple toy model and try to reproduce the issue. Find the true root cause. Either that solves it or you get back here with the actual root cause. From what you are sharing, it should work, hence you have to dig deeper yourself :) – Benjamin Jan 27 '23 at 13:23