diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-10-28 15:18:38 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-11-02 13:56:50 +0100 |
| commit | 79a2f31c800c23539c413771a3f893c423275372 (patch) | |
| tree | 014c96695dd0889db041c6f73f5332d22004e3fc /opendc-compute/opendc-compute-workload | |
| parent | a8e2d460a3b6803845687585ae0b34e67a9445a3 (diff) | |
refactor(trace): Support gaps in trace data
This change updates the implementation of the trace converter and
SimTrace implementation to support cases where there is a gap between
samples in the trace data.
This change allows users to specify what to do in case samples are
missing in the trace. The available options are specified in
`SimTrace.FillMode`. Currently, we support either carrying the previous
value forward or set the usage to zero.
Diffstat (limited to 'opendc-compute/opendc-compute-workload')
| -rw-r--r-- | opendc-compute/opendc-compute-workload/src/main/kotlin/org/opendc/compute/workload/ComputeWorkloadLoader.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/opendc-compute/opendc-compute-workload/src/main/kotlin/org/opendc/compute/workload/ComputeWorkloadLoader.kt b/opendc-compute/opendc-compute-workload/src/main/kotlin/org/opendc/compute/workload/ComputeWorkloadLoader.kt index f23becda..36a76f68 100644 --- a/opendc-compute/opendc-compute-workload/src/main/kotlin/org/opendc/compute/workload/ComputeWorkloadLoader.kt +++ b/opendc-compute/opendc-compute-workload/src/main/kotlin/org/opendc/compute/workload/ComputeWorkloadLoader.kt @@ -71,8 +71,8 @@ public class ComputeWorkloadLoader(private val baseDir: File) { val cores = reader.getInt(coresCol) val cpuUsage = reader.getDouble(usageCol) - val timeMs = time.toEpochMilli() - val deadlineMs = timeMs + duration.toMillis() + val deadlineMs = time.toEpochMilli() + val timeMs = (time - duration).toEpochMilli() val builder = fragments.computeIfAbsent(id) { Builder() } builder.add(timeMs, deadlineMs, cpuUsage, cores) } |
