Ok, I did some tests and here is the excerpts from the log where URS gets info from StatServer:
1801 and 1802 are agents
try #1:
_M_I_00ba015e5637d003 [17:0e] virtual queue "VQ_Testk"(id=2), VQ 100d6d7b0 (1 targets): SELECT MAX by statistic StatAgentLoading(random )
_M_I_00ba015e5637d003 [17:0b] VQ 100d6d7b0 target "VAG_Modem" (#1, 2-0 components): SELECT MAX by statistic StatAgentLoading(random)
15:36:39.799_M_I_ [10:0a] object Place_A_8001|Resources| is unblocked
15:36:39.799_M_I_ [10:0a] object 1801|Resources| is unblocked
1
_M_I_00ba015e5637d003 [10:0c] tenant Resources Agent 1801: dn 8001(ready since 1156314896) is OK
_M_I_00ba015e5637d003 [17:0b] component #1 1801: statvalues: 0 1156314896 13119(S) the best
_M_I_00ba015e5637d003 [17:0b] component #2 1802: statvalues: 0 1156314957 4339(S) pass
_M_I_00ba015e5637d003 [17:0b] VQ 100d6d7b0 target "VAG_Test": component 1801 was SELECTED
_M_I_00ba015e5637d003 [17:0e] target VAG_Test: statvalues: 0 1156314896 13119(S) the best
_M_I_00ba015e5637d003 [17:0e] virtual queue "VQ_Testk"(id=2), VQ 100d6d7b0: target "VAG_Test" for route was SELECTED
so, it chose 1801.
Next, after receiving a call and hanging up, I set both agents to not ready and then set 1801 to ready and wait one minute.
After one minute I set 1802 to ready too and place call to VAG_Test one more time.
What do we get:
_M_I_00ba015e5637d004 [10:0c] tenant Resources Agent 1801: dn 8001(ready since 1156315076) is OK
_M_I_00ba015e5637d004 [17:0b] component #1 1801: statvalues: 0 1156315076 24595(S) the best
_M_I_00ba015e5637d004 [17:0b] component #2 1802: statvalues: 0 1156315137 20621(S) pass
_M_I_00ba015e5637d004 [17:0b] VQ 100d6d7b0 target "VAG_Test": component 1801 was SELECTED
1801 was selected again...
In fact, even after several calls after that, 1801 was continuously selected as long as its Ready was longer than 1802:
_M_I_00ba015e5637d006 [17:0e] virtual queue "VQ_Test"(id=5), VQ 100d6d7b0 (1 targets): SELECT MAX by statistic StatAgentLoading(random )
_M_I_00ba015e5637d006 [17:0b] VQ 100d6d7b0 target "VAG_Test" (#1, 2-0 components): SELECT MAX by statistic StatAgentLoading(random)
15:44:26.551_M_I_ [10:0a] object Place_A_8001|Resources| is unblocked
15:44:26.551_M_I_ [10:0a] object 1801|Resources| is unblocked
15:44:26.551_M_I_ [10:0a] object 8001|Switch_S8700| is unblocked
_M_I_00ba015e5637d006 [10:0c] tenant Resources Agent 1801: dn 8001(ready since 1156315375) is OK
_M_I_00ba015e5637d006 [17:0b] component #1 1801: statvalues: 0 1156315375 8479(S) the best
_M_I_00ba015e5637d006 [17:0b] component #2 1802: statvalues: 0 1156315435 203(S) pass
_M_I_00ba015e5637d006 [17:0b] VQ 100d6d7b0 target "VAG_Test": component 1801 was SELECTED
Digging into logs, we see that StatServer returns two targets: 1801 and 1802
_M_I_00ba015e5637d006 [17:0b] component #1 1801: statvalues: 0 1156315375 8479(S) the best
_M_I_00ba015e5637d006 [17:0b] component #2 1802: statvalues: 0 1156315435 203(S) pass
1801 and 1802 stat values are shown and 1801 is chosen over 1802
I have no clue what "0 1156315375 8479" represents, but I assume some sort of priority/capacity + ReadyTime start and total time in Ready Time plus some random number we are not aware of. Of course, this is my guess, so if someone can decode this - it will help us understand this a bit more.
This behavior is identical for TimeInReadyState and StatAgentLoading, therefore, VAG can be used without ExpandGroup and StatServer does indeed look at individual agents when deciding on the best target inside the group even when you do not expand it.
Not bad.
I used URS 7.0 with 7.0 StatServer, so any version after 7.0 should be functional.
Vic