use of org.apache.jena.atlas.lib.Timer in project jena by apache.
the class TDBLoader method loadModel.
/**
* Load the contents of a list of URLs into a model - may not be as efficient as bulk loading into a TDB graph
*/
public static void loadModel(Model model, List<String> urls, boolean showProgress) {
Timer timer = new Timer();
timer.startTimer();
for (String s : urls) {
if (showProgress)
System.out.printf("Load: %s\n", s);
loadModel(model, s, showProgress);
}
long time = timer.endTimer();
if (showProgress)
System.out.printf("Time for load: %.2fs\n", time / 1000.0);
model.close();
}
use of org.apache.jena.atlas.lib.Timer in project jena by apache.
the class BuilderSecondaryIndexesSequential method createSecondaryIndexes.
// Create each secondary indexes, doing one at a time.
@Override
public void createSecondaryIndexes(TupleIndex primaryIndex, TupleIndex[] secondaryIndexes) {
Timer timer = new Timer();
timer.startTimer();
for (TupleIndex index : secondaryIndexes) {
if (index != null) {
long time1 = timer.readTimer();
LoaderNodeTupleTable.copyIndex(primaryIndex.all(), new TupleIndex[] { index }, index.getMappingStr(), monitor);
long time2 = timer.readTimer();
// if ( printTiming )
// printf("Time for %s indexing: %.2fs\n", index.getLabel(), (time2-time1)/1000.0) ;
// if ( printTiming )
// printer.println() ;
}
}
}
use of org.apache.jena.atlas.lib.Timer in project jena by apache.
the class QueryIteratorTiming method start.
private void start() {
if (timer == null) {
timer = new Timer();
timer.startTimer();
milliseconds = NotFinished;
}
}
use of org.apache.jena.atlas.lib.Timer in project jena by apache.
the class GraphLoadMonitor method resetTimer.
public void resetTimer() {
if (timer != null)
timer.endTimer();
timer = new Timer();
timer.startTimer();
}
use of org.apache.jena.atlas.lib.Timer in project jena by apache.
the class ProcBuildIndexX method exec.
// Sort and build.
// K1="-k 1,1"
// K2="-k 2,2"
// K3="-k 3,3"
// K4="-k 4,4"
//
// generate_index "$K1 $K2 $K3" "$DATA_TRIPLES" SPO
// generate_index "$K2 $K3 $K1" "$DATA_TRIPLES" POS
// generate_index "$K3 $K1 $K2" "$DATA_TRIPLES" OSP
// generate_index "$K1 $K2 $K3 $K4" "$DATA_QUADS" GSPO
// generate_index "$K1 $K3 $K4 $K2" "$DATA_QUADS" GPOS
// generate_index "$K1 $K4 $K2 $K3" "$DATA_QUADS" GOSP
// generate_index "$K2 $K3 $K4 $K1" "$DATA_QUADS" SPOG
// generate_index "$K3 $K4 $K2 $K1" "$DATA_QUADS" POSG
// generate_index "$K4 $K2 $K3 $K1" "$DATA_QUADS" OSPG
public static void exec(String location, String indexName, int sortThreads, /*unused*/
String sortIndexArgs, XLoaderFiles loaderFiles) {
Timer timer = new Timer();
FmtLog.info(BulkLoaderX.LOG_Index, "Build index %s", indexName);
timer.startTimer();
long items = ProcBuildIndexX.exec2(location, indexName, sortThreads, sortIndexArgs, loaderFiles);
long timeMillis = timer.endTimer();
double xSec = timeMillis / 1000.0;
double rate = items / xSec;
String elapsedStr = BulkLoaderX.milliToHMS(timeMillis);
String rateStr = BulkLoaderX.rateStr(items, timeMillis);
FmtLog.info(BulkLoaderX.LOG_Index, "%s Index %s : %s seconds - %s at %s TPS", BulkLoaderX.StepMarker, indexName, Timer.timeStr(timeMillis), elapsedStr, rateStr);
}
Aggregations