From 2053f6e9f9c7ae55264b861b1b6cf9e47b86c109 Mon Sep 17 00:00:00 2001 From: Martin Vahlensieck Date: Fri, 7 Feb 2025 09:35:49 +0100 Subject: [PATCH 1/3] Do not add the same time twice --- .../org/polypheny/simpleclient/scenario/EvaluationThread.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/polypheny/simpleclient/scenario/EvaluationThread.java b/src/main/java/org/polypheny/simpleclient/scenario/EvaluationThread.java index 412afd0..d8de9e1 100644 --- a/src/main/java/org/polypheny/simpleclient/scenario/EvaluationThread.java +++ b/src/main/java/org/polypheny/simpleclient/scenario/EvaluationThread.java @@ -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 { From 0305d3d1bbd5adf0e01d1e24232833d8f4c87814 Mon Sep 17 00:00:00 2001 From: Martin Vahlensieck Date: Thu, 2 Jan 2025 11:30:24 +0100 Subject: [PATCH 2/3] Add a request timeout for status queries --- .../executor/PolyphenyDbExecutor.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/polypheny/simpleclient/executor/PolyphenyDbExecutor.java b/src/main/java/org/polypheny/simpleclient/executor/PolyphenyDbExecutor.java index 96e26a8..b4ff1ae 100644 --- a/src/main/java/org/polypheny/simpleclient/executor/PolyphenyDbExecutor.java +++ b/src/main/java/org/polypheny/simpleclient/executor/PolyphenyDbExecutor.java @@ -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; @@ -720,34 +721,37 @@ class StatusGatherer { private final List 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() ) ); } From e30c38bc489933092980cbef89076aa862c790b7 Mon Sep 17 00:00:00 2001 From: Martin Vahlensieck Date: Wed, 8 Jan 2025 16:47:21 +0100 Subject: [PATCH 3/3] Record various cache-sizes after warmup --- .../java/org/polypheny/simpleclient/main/ChronosAgent.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/polypheny/simpleclient/main/ChronosAgent.java b/src/main/java/org/polypheny/simpleclient/main/ChronosAgent.java index 57798c0..707593a 100644 --- a/src/main/java/org/polypheny/simpleclient/main/ChronosAgent.java +++ b/src/main/java/org/polypheny/simpleclient/main/ChronosAgent.java @@ -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();