CLI client, SSE
This commit is contained in:
@@ -102,7 +102,7 @@ object CLI {
|
||||
data class ID(val id: Uuid) : IProjectIdentification, ILabelIdentification
|
||||
|
||||
sealed interface IData<T> {
|
||||
abstract fun toList(): List<T>
|
||||
fun toList(): List<T>
|
||||
}
|
||||
data class DirectData<T>(val data: List<T>) : IData<T> {
|
||||
override fun toList(): List<T> = data
|
||||
@@ -110,6 +110,7 @@ object CLI {
|
||||
data class FileData<T>(val file: InputStream, val parse: (String) -> T?) : IData<T> {
|
||||
override fun toList(): List<T> {
|
||||
val raw = file.bufferedReader().use { it.readText() }.split(',')
|
||||
|
||||
val parsed = ArrayList<T>(raw.size)
|
||||
val errors = mutableListOf<String>()
|
||||
raw.forEach {
|
||||
|
||||
@@ -147,6 +147,7 @@ object ProjectHandlers {
|
||||
}
|
||||
val warmupData = warmup.ensure("warmup").toList()
|
||||
val measureData = measurement.ensure("measurements").toList()
|
||||
println("Loaded ${warmupData.size} warmup elements, ${measureData.size} measurements")
|
||||
val timeUnit = unit.maybePrompt("time unit for data") {
|
||||
when(it) {
|
||||
in setOf("ns", "nano", "nanosec") -> TimeUnit.NANOS
|
||||
|
||||
Reference in New Issue
Block a user