summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-proto/src/main/kotlin
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-06 22:42:31 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-10 11:54:51 +0200
commit5b8dfc78496452bd23fab59e3ead84a8941da779 (patch)
treef45c9c7ccb367bcb291edf535fba0981b104933b /opendc-web/opendc-web-proto/src/main/kotlin
parent5c05d729b83dfc367bf19e8559569030f6e400b3 (diff)
feat(web/server): Add support for accounting simulation time
This change updates the Quarkus-based web server to add support for tracking and limiting the simulation minutes used by the user in order to prevent misuse of shared resources.
Diffstat (limited to 'opendc-web/opendc-web-proto/src/main/kotlin')
-rw-r--r--opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Job.kt7
1 files changed, 6 insertions, 1 deletions
diff --git a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Job.kt b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Job.kt
index dfaaa09e..4f21f0bb 100644
--- a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Job.kt
+++ b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Job.kt
@@ -36,11 +36,16 @@ public data class Job(
val state: JobState,
val createdAt: Instant,
val updatedAt: Instant,
+ val runtime: Int,
val results: Map<String, Any>? = null
) {
/**
* A request to update the state of a job.
+ *
+ * @property state The next state of the job.
+ * @property runtime The runtime of the job (in seconds).
+ * @property results The results of the job.
*/
@Schema(name = "Runner.Job.Update")
- public data class Update(val state: JobState, val results: Map<String, Any>? = null)
+ public data class Update(val state: JobState, val runtime: Int, val results: Map<String, Any>? = null)
}