@Override protected void finishRead() { finishMonitor() ; printAtEnd() ; }
private void printAtEnd() { long timeMilli = timer.getTimeInterval() ; println(summaryLabel, num(getAddCount())+ " triples: loaded in "+ num(timeMilli/1000.0F)+ " seconds ["+ num(1000F*getAddCount()/timeMilli)+ " triples/s]") ; }
public GraphLoadMonitor(int addNotePoint, boolean displayMemory) { super(addNotePoint) ; this.displayMemory = displayMemory ; resetTimer() ; }
@Override protected void addTick() { long soFar = timer.readTimer() ; long thisTime = soFar - lastTime ; long count = getAddCount() ; long ticks = getAddTicks() ; // *1000L is milli to second conversion // addNotePoint/ (thisTime/1000L) long tpsBatch = (getAddTickSize() * 1000L) / thisTime; long tpsAvg = (count * 1000L) / soFar; String msg = "Add: "+num(count)+" triples (Batch: "+num(tpsBatch)+" / Run: "+num(tpsAvg)+")" ; if ( label != null ) msg = msg+label ; if ( displayMemory ) { long mem = Runtime.getRuntime().totalMemory() ; long free = Runtime.getRuntime().freeMemory() ; msg = msg+" [M:"+num(mem)+"/F:"+num(free)+"]" ; } println(label, msg) ; if ( ticks > 0 && (ticks%10) == 0 ) { String x = num(soFar/1000F) ; String timestamp = StringUtils.str(new Date()) ; println(label, " Elapsed: "+x+" seconds ["+timestamp+"]") ; } lastTime = soFar ; }
private void monitor(Graph graph) { GraphLoadMonitor m = new GraphLoadMonitor(20000,false) ; //m.setSummaryLabel(getCommandName()) ; graph.getEventManager().register(m) ; }
@Override protected void startRead() { startMonitor() ; }
public long triplesLoaded() { return getAddCount() ; }
private void monitor(Graph graph) { GraphLoadMonitor m = new GraphLoadMonitor(20000,false) ; //m.setSummaryLabel(getCommandName()) ; graph.getEventManager().register(m) ; }
public void startMonitor() { resetTimer() ; }