Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix/version-check' into fix/vers…
Browse files Browse the repository at this point in the history
…ion-check
  • Loading branch information
nck-mlcnv committed Nov 27, 2024
2 parents ae151c6 + 90a0c65 commit a5f2455
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_version.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Checks if version number has been updated
name: Version Check
on: pull_request
# on: push

jobs:
lint:
name: Release Tag existence Check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public Path convert(String value) {

@Parameter(names = {"--version", "-v"}, description = "Outputs the version number of the program and result ontology.")
private boolean version;

@Parameter(names = {"--log-success", "-ls"}, description = "Log successful queries.")
public static boolean logSuccess = false;
}

private static final Logger LOGGER = LoggerFactory.getLogger(MainController.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.jpountz.xxhash.StreamingXXHash64;
import net.jpountz.xxhash.XXHashFactory;
import org.aksw.iguana.cc.config.elements.ConnectionConfig;
import org.aksw.iguana.cc.controller.MainController;
import org.aksw.iguana.cc.query.handler.QueryHandler;
import org.aksw.iguana.cc.utils.http.RequestFactory;
import org.aksw.iguana.cc.worker.ResponseBodyProcessor;
Expand Down Expand Up @@ -468,10 +469,12 @@ private static HttpExecutionResult createFailedResultDuringResponse(

private void logExecution(ExecutionStats execution) {
switch (execution.endState()) {
case SUCCESS -> LOGGER.debug("{}\t:: Successfully executed query: [queryID={}].", this, execution.queryID());
case SUCCESS -> {
if (MainController.Args.logSuccess) LOGGER.info("{}\t:: Successfully executed query: [queryID={}, duration={}].", this, execution.queryID(), execution.duration());
}
case TIMEOUT -> LOGGER.warn("{}\t:: Timeout during query execution: [queryID={}, duration={}].", this, execution.queryID(), execution.duration()); // TODO: look for a possibility to add the query string for better logging
case HTTP_ERROR -> LOGGER.warn("{}\t:: HTTP Error occurred during query execution: [queryID={}, httpError={}].", this, execution.queryID(), execution.httpStatusCode().orElse(-1));
case MISCELLANEOUS_EXCEPTION -> LOGGER.warn("{}\t:: Miscellaneous exception occurred during query execution: [queryID={}, exception={}].", this, execution.queryID(), execution.error().orElse(null));
case MISCELLANEOUS_EXCEPTION -> LOGGER.warn("{}\t:: Miscellaneous exception occurred during query execution: [queryID={}].", this, execution.queryID(), execution.error().orElse(null));
}
}

Expand Down

0 comments on commit a5f2455

Please sign in to comment.