public <T extends Average> T add(long num) { super.add(num); min=Math.min(min, num); max=Math.max(max, num); if(values != null) values.add(num); return (T)this; }
public boolean decrementIfEnoughCredits(final Message msg, int credits, long timeout) { lock.lock(); try { if(decrement(credits)) return true; if(timeout <= 0) return false; long start=System.nanoTime(); try { credits_available.await(timeout, TimeUnit.MILLISECONDS); } catch(InterruptedException e) { } num_blockings++; avg_blockings.add(System.nanoTime() - start); return decrement(credits); } finally { lock.unlock(); } }
avg_block_time.add(System.nanoTime() - start); return decrement(credits);
public Object up(Message msg) { PerfHeader hdr=msg.getHeader(id); if(hdr == null) log.error("%s: no perf header found", local_addr); else { long time=System.nanoTime() - hdr.start_time; if(time <= 0) log.error("%d: time is <= 0", time); else avg.add(time); } return up_prot.up(msg); }
public void up(MessageBatch batch) { for(Message msg: batch) { PerfHeader hdr=msg.getHeader(id); if(hdr == null) log.error("%s: no perf header found", local_addr); else { long time=System.nanoTime() - hdr.start_time; if(time <= 0) log.error("%d: time is <= 0", time); else avg.add(time); } } super.up(batch); }
if(!all_received) System.err.printf("didn't receive all responses: %s\n", rsps); avg.add(time_ns); min=Math.min(min, time_ns); max=Math.max(max, time_ns);
public <T extends Average> T add(long num) { super.add(num); min=Math.min(min, num); max=Math.max(max, num); if(values != null) values.add(num); return (T)this; }
public boolean decrementIfEnoughCredits(final Message msg, int credits, long timeout) { lock.lock(); try { if(decrement(credits)) return true; if(timeout <= 0) return false; long start=System.nanoTime(); try { credits_available.await(timeout, TimeUnit.MILLISECONDS); } catch(InterruptedException e) { } num_blockings++; avg_blockings.add(System.nanoTime() - start); return decrement(credits); } finally { lock.unlock(); } }
avg_block_time.add(System.nanoTime() - start); return decrement(credits);
public Object up(Message msg) { PerfHeader hdr=msg.getHeader(id); if(hdr == null) log.error("%s: no perf header found", local_addr); else { long time=System.nanoTime() - hdr.start_time; if(time <= 0) log.error("%d: time is <= 0", time); else avg.add(time); } return up_prot.up(msg); }
public void up(MessageBatch batch) { for(Message msg: batch) { PerfHeader hdr=msg.getHeader(id); if(hdr == null) log.error("%s: no perf header found", local_addr); else { long time=System.nanoTime() - hdr.start_time; if(time <= 0) log.error("%d: time is <= 0", time); else avg.add(time); } } super.up(batch); }
if(!all_received) System.err.printf("didn't receive all responses: %s\n", rsps); avg.add(time_ns); min=Math.min(min, time_ns); max=Math.max(max, time_ns);