1 20 21 package org.jacorb.orb.giop; 22 23 24 28 29 public class LFUStatisticsProviderImpl 30 implements StatisticsProvider 31 { 32 private long lifetime_begin = 0; 33 private long invocations = 0; 34 35 public LFUStatisticsProviderImpl() 36 { 37 lifetime_begin = System.currentTimeMillis(); 38 } 39 40 44 public void messageChunkSent( int size ) 45 { 46 } 47 48 52 public void flushed() 53 { 54 ++invocations; 55 } 56 57 58 62 public void messageReceived( int size ) 63 { 64 ++invocations; 65 } 66 67 public double getFrequency() 68 { 69 double lifetime = System.currentTimeMillis() - lifetime_begin; 70 return invocations / lifetime; 71 } 72 } 73 74 75 76 | Popular Tags |