Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.concurrent.atomic.AtomicInteger;
import kong.unirest.core.HttpResponse;
import kong.unirest.core.Unirest;
import kong.unirest.core.UnirestInstance;
import kong.unirest.core.json.JSONArray;
import kong.unirest.core.json.JSONObject;
import lombok.Getter;
Expand Down Expand Up @@ -720,34 +721,37 @@ class StatusGatherer {
private final List<PolyphenyStatus> statuses = new ArrayList<>();

private final String url;
private final UnirestInstance unirest;


private StatusGatherer() {
url = "http://" + ChronosCommand.hostname + ":" + PolyphenyVersionSwitch.getInstance().uiPort + "/status/";
unirest = Unirest.spawnInstance();
unirest.config().requestTimeout( 30000 );
}


public PolyphenyStatus gatherOnce() {
return new PolyphenyStatus(
Long.parseLong( Unirest.get( url + "memory-current" ).asString().getBody() ),
Integer.parseInt( Unirest.get( url + "transactions-active" ).asString().getBody() ),
Integer.parseInt( Unirest.get( url + "monitoring-queue" ).asString().getBody() )
Long.parseLong( unirest.get( url + "memory-current" ).asString().getBody() ),
Integer.parseInt( unirest.get( url + "transactions-active" ).asString().getBody() ),
Integer.parseInt( unirest.get( url + "monitoring-queue" ).asString().getBody() )
);
}


public PolyphenyFullStatus gatherFullOnce() {
return new PolyphenyFullStatus(
Unirest.get( url + "uuid" ).asString().getBody(),
Unirest.get( url + "version" ).asString().getBody(),
Unirest.get( url + "hash" ).asString().getBody(),
Long.parseLong( Unirest.get( url + "memory-current" ).asString().getBody() ),
Integer.parseInt( Unirest.get( url + "transactions-since-restart" ).asString().getBody() ),
Integer.parseInt( Unirest.get( url + "transactions-active" ).asString().getBody() ),
Integer.parseInt( Unirest.get( url + "cache-implementation" ).asString().getBody() ),
Integer.parseInt( Unirest.get( url + "cache-queryplan" ).asString().getBody() ),
Integer.parseInt( Unirest.get( url + "cache-routingplan" ).asString().getBody() ),
Integer.parseInt( Unirest.get( url + "monitoring-queue" ).asString().getBody() )
unirest.get( url + "uuid" ).asString().getBody(),
unirest.get( url + "version" ).asString().getBody(),
unirest.get( url + "hash" ).asString().getBody(),
Long.parseLong( unirest.get( url + "memory-current" ).asString().getBody() ),
Integer.parseInt( unirest.get( url + "transactions-since-restart" ).asString().getBody() ),
Integer.parseInt( unirest.get( url + "transactions-active" ).asString().getBody() ),
Integer.parseInt( unirest.get( url + "cache-implementation" ).asString().getBody() ),
Integer.parseInt( unirest.get( url + "cache-queryplan" ).asString().getBody() ),
Integer.parseInt( unirest.get( url + "cache-routingplan" ).asString().getBody() ),
Integer.parseInt( unirest.get( url + "monitoring-queue" ).asString().getBody() )
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,11 @@ protected Object warmUp( ChronosJob chronosJob, final File inputDirectory, final
if ( config.router != null && config.router.equals( "icarus" ) && PolyphenyVersionSwitch.getInstance().hasIcarusRoutingSettings ) {
polyphenyDbInstance.setIcarusRoutingTraining( false );
}
PolyphenyFullStatus status = polyphenyDbInstance.getStatusGatherer().gatherFullOnce();
properties.put( "pdbStatus_implementationCacheSize_after_warmup", status.implementationCacheSize() );
properties.put( "pdbStatus_queryPlanCacheSize_after_warmup", status.queryPlanCacheSize() );
properties.put( "pdbStatus_routingPlanCacheSize_after_warmup", status.routingPlanCacheSize() );
properties.put( "pdbStatus_monitoringQueueSize_after_warmup", status.monitoringQueueSize() );
}
} catch ( Exception e ) {
databaseInstance.tearDown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ public void run() {
measuredTimes.add( measuredTime );
measuredTimePerQueryType.get( queryListEntry.templateId ).add( measuredTime );
for ( Integer id : queryListEntry.templateIds ) {
measuredTimePerQueryType.get( id ).add( measuredTime );
if ( id != queryListEntry.templateId ) {
measuredTimePerQueryType.get( id ).add( measuredTime );
}
}
if ( commitAfterEveryQuery ) {
try {
Expand Down