Skip to content

Commit dc2a60c

Browse files
committed
Review comments
1 parent c57198a commit dc2a60c

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

articles/communication-services/concepts/router/distribution-concepts.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ ms.service: azure-communication-services
1818

1919
When creating a distribution policy, we specify one of the following distribution modes to define the strategy to use when distributing jobs to workers:
2020

21-
## Round Robin Mode
21+
## Round robin mode
2222
Jobs will be distributed in a circular fashion such that each available worker will receive jobs in sequence.
2323

24-
## Longest Idle Mode
24+
## Longest idle mode
2525
Jobs will be distributed to the worker that is least utilized first. If there's a tie, we'll pick the worker that has been available for the longer time. Utilization is calculated as a `Load Ratio` by the following algorithm:
2626

2727
Load Ratio = Aggregate of capacity consumed by all jobs assigned to the worker / Total capacity of the worker
@@ -53,19 +53,18 @@ TotalCapacity = 3
5353
ConsumedScore = 0 (Currently idle)
5454
LoadRatio = 0 / 4 = 0
5555
LastAvailable: 2 min ago
56-
```
57-
Workers would be matched in order: D, C, A, B
5856
59-
Explanation:
57+
Workers would be matched in order: D, C, A, B
58+
```
6059

6160
Worker D has the lowest load ratio (0), so Worker D will be offered the job first. Workers A and C are tied with the same load ratio (0.6). However, Worker C has been available for a longer time (7 minutes ago) than Worker A (5 minutes ago), so Worker C will be matched before Worker A. Finally, Worker B will be matched last since Worker B has the highest load ratio (0.75).
6261

63-
## Best Worker Mode
62+
## Best worker mode
6463
The workers that are best able to handle the job are picked first. The logic to rank Workers can be customized, with an expression or Azure function to compare two workers by specifying a Scoring Rule. [See example][worker-scoring]
6564

6665
When a Scoring Rule isn't provided, this distribution mode will use the default scoring method instead, which evaluates workers based on how the job's labels and selectors match with the worker's labels. The algorithms are outlined below.
6766

68-
### Default Label Matching
67+
### Default label matching
6968
For calculating a score based on the job's labels, we increment the `Match Score` by 1 for every worker label that matches a corresponding label on the job and then divide by the total number of labels on the job. Therefore, the more labels that matched, the higher a worker's `Match Score`. The final `Match Score` will always be a value between 0 and 1.
7069

7170
##### Example
@@ -117,11 +116,11 @@ Worker C's match score = 1 (for matching english language label) / 2 (total numb
117116

118117
Worker A would be matched first. Next, Worker B or Worker C would be matched, depending on who was available for a longer time, since the match score is tied.
119118

120-
### Default Worker Selector Matching
119+
### Default worker selector matching
121120
In the case where the job also contains worker selectors, we'll calculate the `Match Score` based on the `LabelOperator` of that worker selector.
122121

123-
#### Equal/NotEqual Label Operators
124-
If the worker selector has the `LabelOperator` `Equal` or `NotEqual`, we increment the score by 1 for each job label that matches that worker selector, in a similar manner as the `Label Matching` above.
122+
#### Equal/notEqual label operators
123+
If the worker selector has the `LabelOperator` `Equal` or `NotEqual`, we increment the score by 1 for each job label that matches that worker selector, in a similar manner as the `Label Matching` above.
125124

126125
##### Example
127126
Job 2:
@@ -172,10 +171,10 @@ Worker F's match score = 1 (for segment not equal to vip) / 2 (total number of l
172171

173172
Worker E would be matched first. Next, Worker D or Worker F would be matched, depending on who was available for a longer time, since the match score is tied.
174173

175-
#### Other Label Operators
176-
For worker selectors using operators that compare by magnitude (GreaterThan/GreaterThanEqual/LessThan/LessThanEqual), we'll increment the worker's `Match Score` by an amount calculated using the logistic function (See Fig 1). The calculation is based on how much the worker's label value exceeds the worker selector's value or a lesser amount if it doesn't exceed the worker selector's value. Therefore, the more worker selector values the worker exceeds, and the greater the degree to which it does so, the higher a worker's score will be.
174+
#### Other label operators
175+
For worker selectors using operators that compare by magnitude (`GreaterThan`/`GreaterThanEqual`/`LessThan`/`LessThanEqual`), we'll increment the worker's `Match Score` by an amount calculated using the logistic function (See Fig 1). The calculation is based on how much the worker's label value exceeds the worker selector's value or a lesser amount if it doesn't exceed the worker selector's value. Therefore, the more worker selector values the worker exceeds, and the greater the degree to which it does so, the higher a worker's score will be.
177176

178-
:::image type="content" source="../media/router/logistic-function.png" alt-text="Fig 1. Logistic function.":::
177+
:::image type="content" source="../media/router/distribution-concepts/logistic-function.png" alt-text="Diagram that shows logistic function.":::
179178

180179
Fig 1. Logistic function
181180

0 commit comments

Comments
 (0)