Revision e0f05cb2

View differences:

topology.c
212 212
    return;
213 213
  }
214 214

  
215
  fprintf(stderr,"Topo modify start\n");
216
  peers = peerset_get_peers(pset);
217
  for (i = 0; i < peerset_size(pset); i++) {
218
    fprintf(stderr," %s - RTT: %f\n", node_addr(peers[i].id) , get_rtt(peers[i].id));
219
  }
220

  
215 221
  ids = topoGetNeighbourhood(&n_ids);	//TODO handle both tman and topo
216 222
  metas = topGetMetadata(&metasize);	//TODO: check metasize
217 223
  for(i = 0; i < n_ids; i++) {
......
243 249

  
244 250

  
245 251
  n_ids = peerset_size(pset);
252
  fprintf(stderr,"Topo remove start (peers:%d)\n", n_ids);
246 253
  while (NEIGHBORHOOD_TARGET_SIZE && peerset_size(pset) > NEIGHBORHOOD_TARGET_SIZE) { //reduce back neighbourhood to target size
247 254
    int n, desired, desired_not, desired_unknown;
248 255
    struct peer *ds[n_ids], *dns[n_ids], *dus[n_ids];
......
268 275
      }
269 276
    }
270 277
    alpha = (double) desired / n;
271
    fprintf(stderr,"peers:%d desired:%d unknown:%d notdesired:%d alpha: %f (target:%f)\n",n, desired, desired_unknown, desired_not, alpha, alpha_target);
278
    fprintf(stderr," peers:%d desired:%d unknown:%d notdesired:%d alpha: %f (target:%f)\n",n, desired, desired_unknown, desired_not, alpha, alpha_target);
272 279

  
273 280
    if (alpha > alpha_target && desired > 0) {
274 281
      remove_peer(ds[rand() % desired]->id);
......
280 287
      remove_peer(peers[rand() % n].id);
281 288
    }
282 289
  }
290
  fprintf(stderr,"Topo remove end\n");
283 291

  
284 292
  reg_neigh_size(peerset_size(pset));
285 293
}

Also available in: Unified diff