summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-proto/src/main/java
diff options
context:
space:
mode:
authorvincent van beek <vincent@vlogic.nl>2026-04-15 16:19:02 +0200
committerGitHub <noreply@github.com>2026-04-15 16:19:02 +0200
commit11e355321db20b70c76c35b6e8fc36dbb9d97fc6 (patch)
treef12b8c8c2b6a642b315f2e4a7e54274bbcdb60be /opendc-web/opendc-web-proto/src/main/java
parent3e52cd36bed9455105f4a8c3d83ec805c1fb7b70 (diff)
add a job report to the scenario overview with details and time data (#406)
* add a job report to the scenario overview with details and time data * create Report data class
Diffstat (limited to 'opendc-web/opendc-web-proto/src/main/java')
-rw-r--r--opendc-web/opendc-web-proto/src/main/java/org/opendc/web/proto/runner/Job.java4
-rw-r--r--opendc-web/opendc-web-proto/src/main/java/org/opendc/web/proto/runner/Report.java51
2 files changed, 54 insertions, 1 deletions
diff --git a/opendc-web/opendc-web-proto/src/main/java/org/opendc/web/proto/runner/Job.java b/opendc-web/opendc-web-proto/src/main/java/org/opendc/web/proto/runner/Job.java
index 587fe451..c8ec8d92 100644
--- a/opendc-web/opendc-web-proto/src/main/java/org/opendc/web/proto/runner/Job.java
+++ b/opendc-web/opendc-web-proto/src/main/java/org/opendc/web/proto/runner/Job.java
@@ -36,6 +36,7 @@ public record Job(
Scenario scenario,
JobState state,
Instant createdAt,
+ Instant startedAt,
Instant updatedAt,
int runtime,
Map<String, ?> results) {
@@ -45,7 +46,8 @@ public record Job(
* @param state The next state of the job.
* @param runtime The runtime of the job (in seconds).
* @param results The results of the job.
+ * @param report The report containing warnings and errors.
*/
@Schema(name = "Runner.Job.Update")
- public record Update(JobState state, int runtime, Map<String, ?> results) {}
+ public record Update(JobState state, int runtime, Map<String, ?> results, Report report) {}
}
diff --git a/opendc-web/opendc-web-proto/src/main/java/org/opendc/web/proto/runner/Report.java b/opendc-web/opendc-web-proto/src/main/java/org/opendc/web/proto/runner/Report.java
new file mode 100644
index 00000000..8ade8def
--- /dev/null
+++ b/opendc-web/opendc-web-proto/src/main/java/org/opendc/web/proto/runner/Report.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2024 AtLarge Research
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package org.opendc.web.proto.runner;
+
+import java.util.List;
+import org.eclipse.microprofile.openapi.annotations.media.Schema;
+
+/**
+ * A report containing metadata, logs, and summary information about a simulation job.
+ */
+@Schema(name = "Runner.Report")
+public record Report(String createdAt, String startedAt, List<LogEntry> logs, Summary summary, ErrorInfo error) {
+
+ /**
+ * A single log entry captured during simulation execution.
+ */
+ @Schema(name = "Runner.Report.LogEntry")
+ public record LogEntry(String timestamp, String level, String logger, String message) {}
+
+ /**
+ * Aggregate summary of the simulation job.
+ */
+ @Schema(name = "Runner.Report.Summary")
+ public record Summary(int totalWarnings, int totalErrors, Integer runtimeSeconds, Integer waitTimeSeconds) {}
+
+ /**
+ * Error information when a simulation job fails.
+ */
+ @Schema(name = "Runner.Report.ErrorInfo")
+ public record ErrorInfo(String message, String type, String stackTrace) {}
+}