summaryrefslogtreecommitdiff
path: root/opendc/opendc-format/src
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2020-04-16 01:35:33 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-04-16 01:43:06 +0200
commite097aeb16d77c260126b65c7f13330076d800d52 (patch)
tree4817f29b471557de92f8e2c75e385b9522364150 /opendc/opendc-format/src
parent0a8ec3216642b0991d53baff5498916fc859009a (diff)
perf: Convert traces to Parquet format
Diffstat (limited to 'opendc/opendc-format/src')
-rw-r--r--opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt11
1 files changed, 5 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 da678c07..2e2159ba 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
@@ -115,9 +115,9 @@ class Sc20TraceReader(
BufferedReader(FileReader(vmFile)).use { reader ->
reader.lineSequence()
- .chunked(1024)
+ .chunked(128)
.forEach { lines ->
- val res = ArrayList<FlopsHistoryFragment>(lines.size)
+ // val res = ArrayList<FlopsHistoryFragment>(lines.size)
for (line in lines) {
// Ignore comments in the trace
if (line.startsWith("#") || line.isBlank()) {
@@ -144,13 +144,12 @@ class Sc20TraceReader(
val fragment =
FlopsHistoryFragment(timestamp, flops, traceInterval, cpuUsage, cores)
if (last != null) {
- res.add(last!!)
+ yield(last!!)
}
fragment
}
}
-
- yieldAll(res)
+ // yieldAll(res)
}
if (last != null) {
@@ -172,7 +171,7 @@ class Sc20TraceReader(
uuid,
vmId,
mapOf(IMAGE_PERF_INTERFERENCE_MODEL to relevantPerformanceInterferenceModelItems),
- flopsFragments,
+ flopsFragments.asSequence(),
maxCores,
requiredMemory
)