Changes in extensions/rt_load_balance/rt_load_balance.c [1221:6f75842935f6:1273:e831cabceab0] in freeDiameter
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rt_load_balance/rt_load_balance.c
r1221 r1273 3 3 * Author: Thomas Klausner <tk@giga.or.at> * 4 4 * * 5 * Copyright (c) 2013, Thomas Klausner*5 * Copyright (c) 2013, 2014 Thomas Klausner * 6 6 * All rights reserved. * 7 7 * * … … 59 59 CHECK_FCT(fd_peer_get_load_pending(peer, &to_receive, &to_send)); 60 60 load = to_receive + to_send; 61 score = cand->score; 62 if ((cand->score > 0) && (load >= cand->score)) 63 cand->score = 1; 64 else 65 cand->score -= load; 66 TRACE_DEBUG(INFO, "evaluated peer `%.*s', score was %d, now %d", (int)cand->diamidlen, cand->diamid, score, cand->score); 61 /* other routing mechanisms need to add to the 62 * appropriate entries so their base value is high 63 * enough that they are considered */ 64 65 /* logarithmic scaling */ 66 int load_log = 0; 67 while (load > 0) { 68 load_log++; 69 load /= 2; 70 } 71 cand->score -= load_log; 72 TRACE_DEBUG(FULL, "evaluated peer `%.*s', score was %d, now %d", (int)cand->diamidlen, cand->diamid, score, cand->score); 67 73 } 68 74
Note: See TracChangeset
for help on using the changeset viewer.