Browse code

dispatcher: info log message when adding extra weight or rweight percentages

Daniel-Constantin Mierla authored on 10/12/2020 16:04:31
Showing 1 changed files
... ...
@@ -653,6 +653,10 @@ int dp_init_relative_weights(ds_set_t *dset)
653 653
 	/* if the array was not completely filled (i.e., the sum of rweights is
654 654
 	 * less than 100 due to truncated), then use last address to fill the rest */
655 655
 	last_insert = t > 0 ? dset->rwlist[t - 1] : (unsigned int)(dset->nr - 1);
656
+	if(t < 100) {
657
+		LM_INFO("extra rweight %d for last active destination in group %d\n",
658
+				(100-t), dset->id);
659
+	}
656 660
 	for(j = t; j < 100; j++)
657 661
 		dset->rwlist[j] = last_insert;
658 662
 
... ...
@@ -706,6 +710,10 @@ int dp_init_weights(ds_set_t *dset)
706 710
 	}
707 711
 	/* if the array was not completely filled (i.e., the sum of weights is
708 712
 	 * less than 100), then use last address to fill the rest */
713
+	if(t < 100) {
714
+		LM_INFO("extra weight %d for last destination in group %d\n",
715
+				(100-t), dset->id);
716
+	}
709 717
 	for(; t < 100; t++)
710 718
 		dset->wlist[t] = (unsigned int)(dset->nr - 1);
711 719
 randomize: