Skip to content

Commit

Permalink
Temporarily replace TS1 with TS7
Browse files Browse the repository at this point in the history
  • Loading branch information
valentin-boehm committed Feb 14, 2024
1 parent 1a17a2b commit 9dae366
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions src/main/java/de/tum/cit/ase/service/CiStatusService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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());
Expand All @@ -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<Submission> submissions) {
private int getNumberOfResults(List<Submission> submissions) {
return submissions
.stream()
.filter(submission -> submission.getResults() == null || submission.getResults().isEmpty())
.filter(submission -> submission.getResults() != null)
.flatMap(submission -> submission.getResults().stream())
.toList()
.size();
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9dae366

Please sign in to comment.