Skip to content

Commit

Permalink
dispatcher: info log message when adding extra weight or rweight perc…
Browse files Browse the repository at this point in the history
…entages

(cherry picked from commit ba27633)
  • Loading branch information
miconda authored and henningw committed Dec 21, 2020
1 parent 4bc84f4 commit 65b9c2d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/modules/dispatcher/dispatch.c
Expand Up @@ -638,6 +638,10 @@ int dp_init_relative_weights(ds_set_t *dset)
/* if the array was not completely filled (i.e., the sum of rweights is
* less than 100 due to truncated), then use last address to fill the rest */
last_insert = t > 0 ? dset->rwlist[t - 1] : (unsigned int)(dset->nr - 1);
if(t < 100) {
LM_INFO("extra rweight %d for last active destination in group %d\n",
(100-t), dset->id);
}
for(j = t; j < 100; j++)
dset->rwlist[j] = last_insert;

Expand Down Expand Up @@ -691,6 +695,10 @@ int dp_init_weights(ds_set_t *dset)
}
/* if the array was not completely filled (i.e., the sum of weights is
* less than 100), then use last address to fill the rest */
if(t < 100) {
LM_INFO("extra weight %d for last destination in group %d\n",
(100-t), dset->id);
}
for(; t < 100; t++)
dset->wlist[t] = (unsigned int)(dset->nr - 1);
randomize:
Expand Down

0 comments on commit 65b9c2d

Please sign in to comment.