From 9dae366f827219ffa222c45bbd7de7ecefe3902b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Bo=CC=88hm?= Date: Wed, 14 Feb 2024 12:29:30 +0100 Subject: [PATCH] Temporarily replace TS1 with TS7 --- .../java/de/tum/cit/ase/service/CiStatusService.java | 9 +++++---- src/main/resources/config/application.yml | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/java/de/tum/cit/ase/service/CiStatusService.java b/src/main/java/de/tum/cit/ase/service/CiStatusService.java index f88f997d..1975c897 100644 --- a/src/main/java/de/tum/cit/ase/service/CiStatusService.java +++ b/src/main/java/de/tum/cit/ase/service/CiStatusService.java @@ -121,7 +121,7 @@ public void subscribeToCiStatusViaResults(SimulationRun simulationRun, Simulated submissions.addAll(admin.getSubmissions(participation.getId())); } - int numberOfQueuedJobs = getNumberOfSubmissionsWithoutResult(submissions); + int numberOfQueuedJobs = submissions.size() - getNumberOfResults(submissions); status.setTotalJobs(numberOfQueuedJobs); status.setQueuedJobs(numberOfQueuedJobs); status = ciStatusRepository.save(status); @@ -138,7 +138,7 @@ public void subscribeToCiStatusViaResults(SimulationRun simulationRun, Simulated for (var participation : participations) { submissions.addAll(admin.getSubmissions(participation.getId())); } - numberOfQueuedJobs = getNumberOfSubmissionsWithoutResult(submissions); + numberOfQueuedJobs = submissions.size() - getNumberOfResults(submissions); status.setQueuedJobs(numberOfQueuedJobs); status.setTimeInMinutes(status.getTimeInMinutes() + 1); status.setAvgJobsPerMinute((double) (status.getTotalJobs() - status.getQueuedJobs()) / status.getTimeInMinutes()); @@ -151,10 +151,11 @@ public void subscribeToCiStatusViaResults(SimulationRun simulationRun, Simulated log.info("Finished subscribing to CI status for simulation run {}", simulationRun.getId()); } - private int getNumberOfSubmissionsWithoutResult(List submissions) { + private int getNumberOfResults(List submissions) { return submissions .stream() - .filter(submission -> submission.getResults() == null || submission.getResults().isEmpty()) + .filter(submission -> submission.getResults() != null) + .flatMap(submission -> submission.getResults().stream()) .toList() .size(); } diff --git a/src/main/resources/config/application.yml b/src/main/resources/config/application.yml index 537869fe..eb80317a 100644 --- a/src/main/resources/config/application.yml +++ b/src/main/resources/config/application.yml @@ -238,13 +238,13 @@ artemis: vcs: ci: ts1: - url: https://artemis-test1.artemis.cit.tum.de/ + url: https://artemis-test7.artemis.cit.tum.de/ cleanup-enabled: false - is-local: false + is-local: true prometheus-instances: - artemis: artemis-test1.artemis.cit.tum.de:9100 - vcs: bitbucket-prelive-node1.ase.in.tum.de:9100 - ci: bamboo-prelive-instance.ase.in.tum.de:9100 + artemis: artemis-test7.artemis.cit.tum.de:9100 + vcs: + ci: staging: url: https://artemis-staging.artemis.in.tum.de/ cleanup-enabled: false