public void taskFinished() { timer.stop(); }
/** * Set a timeout for the main timer. Used to stop an automated test after a * reasonable amount of time has passed. * * @param timeout */ public void setTimeout(long timeout) { timers.mainTimer.setTimeout( timeout ); }
/** * {@inheritDoc} */ public QueryResult exec(Query query) { if( log.isLoggable( Level.FINE ) ) { log.fine( "Executing query " + query ); } Timer timer = new Timer( "CombinedQueryEngine" ); timer.start(); prepare( query ); branches = 0; exec( new ResultBindingImpl() ); timer.stop(); if( log.isLoggable( Level.FINE ) ) { log.log( Level.FINE, "#B=" + branches + ", time=" + timer.getLast() + " ms." ); } return result; }
public String toString() { if(startCount > 0) return "Timer " + name + " Avg: " + getAverage() + " Count: " + count + " Total: " + getTotal() + " Still running: "+ startCount; return "Timer " + name + " Avg: " + getAverage() + " Count: " + count + " Total: " + getTotal(); }
completionTimer.start(); try { strategy.complete( expr ); completionTimer.stop(); log.fine( "Consistent: " + consistent + " Time: " + t.getElapsed() +" Branches " + abox.branches.size() +" Tree depth: " + abox.stats.treeDepth + " Tree size: " + abox.getNodes().size() t.stop();
public boolean isSubClassOf(ATermAppl c1, ATermAppl c2) { if( !doExplanation ) { Bool isKnownSubClass = isKnownSubClassOf( c1, c2 ); if( isKnownSubClass.isKnown() ) { return isKnownSubClass.isTrue(); } } if( log.isLoggable( Level.FINE ) ) { long count = kb.timers.getTimer( "subClassSat" ) == null ? 0 : kb.timers.getTimer( "subClassSat" ).getCount(); log.fine( count + ") Checking subclass [" + ATermUtils.toString( c1 ) + " " + ATermUtils.toString( c2 ) + "]" ); } ATermAppl notC2 = ATermUtils.negate( c2 ); ATermAppl c = ATermUtils.makeAnd( c1, notC2 ); Timer t = kb.timers.startTimer( "subClassSat" ); boolean sub = !isSatisfiable( c, false ); t.stop(); if( log.isLoggable( Level.FINE ) ) { log.fine( " Result: " + sub + " (" + t.getLast() + "ms)" ); } return sub; }
row.add(timer.getName()); if(!shortForm) { row.add(String.valueOf(timer.getCount())); row.add(nf.format(timer.getAverage())); if( timer.isStarted() ) row.add(String.valueOf(timer.getElapsed())); else row.add(String.valueOf(timer.getTotal())); table.add(row);
Timer timer = timers.createTimer("OntologyCreation"); timer.start(); OWLOntologyManager owlManager = sourcesOntology.getOWLOntologyManager(); OWLDataFactory owlFactory = owlManager.getOWLDataFactory(); timer.stop(); logger.info("Ontology created in " + timer.getAverage() + " (ms)");
public int compare(Timer o1, Timer o2) { if( sortBy.equalsIgnoreCase( "Total" ) ) { long t1 = o1.getTotal(); long t2 = o2.getTotal(); if( t1 == 0 ) t1 = o1.getElapsed(); if( t2 == 0 ) t2 = o2.getElapsed(); return (int)(t2 -t1); } else if( sortBy.equalsIgnoreCase( "Avg" ) ) return (int)(o2.getAverage() - o1.getAverage()); else if( sortBy.equalsIgnoreCase( "Count" ) ) return (int)(o2.getCount() - o1.getCount()); else return AlphaNumericComparator.CASE_INSENSITIVE.compare( o1, o2 ); } });
public Timers() { mainTimer = createTimer("main"); mainTimer.start(); }
public void taskFinished() { super.taskFinished(); setProgress( progressLength ); out.println(); out.print( progressTitle ); out.print( " finished in " ); out.println( DurationFormat.SHORT.format( timer.getLast() ) ); } }
public Timer createTimer(String name) { Timer t = new Timer(name, mainTimer); timers.put(name, t); return t; }
public double getTimerAverage(String name) { Timer timer = getTimer(name); return (timer == null) ? 0 : timer.getAverage(); }
public void addAll( Timers other ) { for( Entry<String, Timer> entry : other.timers.entrySet() ) { String name = entry.getKey(); Timer otherTimer = entry.getValue(); Timer thisTimer = getTimer( name ); if( thisTimer == null ) timers.put( name, otherTimer ); else thisTimer.add( otherTimer ); } }