diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-04-08 15:27:24 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-04-08 15:54:49 +0200 |
| commit | 7a11aff2ff46b0fb3bf01f537946d5fcd66a1e90 (patch) | |
| tree | 71be757043da58f0adaec71c4432e6f5f0135656 /opendc/opendc-format/src | |
| parent | 02864ba50fafffd19bb1b635eea06004d9fd78aa (diff) | |
bug: Fix incorrect reporting of overcommission
Diffstat (limited to 'opendc/opendc-format/src')
2 files changed, 8 insertions, 6 deletions
diff --git a/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt b/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt index 78a58671..e0d81b38 100644 --- a/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt +++ b/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt @@ -103,10 +103,10 @@ class Sc20TraceReader( val flops: Long = (cpuUsage * 5 * 60 * cores).toLong() if (flopsHistory.isEmpty()) { - flopsHistory.add(FlopsHistoryFragment(timestamp, flops, traceInterval, cpuUsage)) + flopsHistory.add(FlopsHistoryFragment(timestamp, flops, traceInterval, cpuUsage, cores)) } else { if (flopsHistory.last().flops != flops) { - flopsHistory.add(FlopsHistoryFragment(timestamp, flops, traceInterval, cpuUsage)) + flopsHistory.add(FlopsHistoryFragment(timestamp, flops, traceInterval, cpuUsage, cores)) } else { val oldFragment = flopsHistory.removeAt(flopsHistory.size - 1) flopsHistory.add( @@ -114,7 +114,8 @@ class Sc20TraceReader( oldFragment.tick, oldFragment.flops + flops, oldFragment.duration + traceInterval, - cpuUsage + cpuUsage, + cores ) ) } diff --git a/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/vm/VmTraceReader.kt b/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/vm/VmTraceReader.kt index 6b8843aa..fbe77654 100644 --- a/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/vm/VmTraceReader.kt +++ b/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/vm/VmTraceReader.kt @@ -101,10 +101,10 @@ class VmTraceReader( val flops: Long = (cpuUsage * 5 * 60 * cores).toLong() if (flopsHistory.isEmpty()) { - flopsHistory.add(FlopsHistoryFragment(timestamp, flops, traceInterval, cpuUsage)) + flopsHistory.add(FlopsHistoryFragment(timestamp, flops, traceInterval, cpuUsage, cores)) } else { if (flopsHistory.last().flops != flops) { - flopsHistory.add(FlopsHistoryFragment(timestamp, flops, traceInterval, cpuUsage)) + flopsHistory.add(FlopsHistoryFragment(timestamp, flops, traceInterval, cpuUsage, cores)) } else { val oldFragment = flopsHistory.removeAt(flopsHistory.size - 1) flopsHistory.add( @@ -112,7 +112,8 @@ class VmTraceReader( oldFragment.tick, oldFragment.flops + flops, oldFragment.duration + traceInterval, - cpuUsage + cpuUsage, + cores ) ) } |
