1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00
This commit is contained in:
Cedric Beust 2017-02-07 16:29:45 -08:00
parent 75dda87fdd
commit ba70a27968

View file

@ -341,31 +341,35 @@ class DynamicGraphExecutor<T>(val graph : DynamicGraph<T>, val factory: IThreadW
fun displayRegularLog(table: AsciiTable.Builder) : AsciiTable.Builder {
if (historyLog.any()) {
val start = historyLog[0].timestamp
val projectStart = ConcurrentHashMap<String, Long>()
historyLog.forEach { line ->
val row = arrayListOf<String>()
row.add(toSeconds(line.timestamp - start))
threadIds.keys.forEach {
if (line.threadId == it) {
var duration = ""
if (line.start) {
projectStart[line.name] = line.timestamp
} else {
val projectStart = projectStart[line.name]
if (projectStart != null) {
duration = " (" + ((line.timestamp - projectStart) / 1000)
.toInt().toString() + ")"
if (historyLog[0] != null) {
val start = historyLog[0].timestamp
val projectStart = ConcurrentHashMap<String, Long>()
historyLog.forEach { line ->
val row = arrayListOf<String>()
row.add(toSeconds(line.timestamp - start))
threadIds.keys.forEach {
if (line.threadId == it) {
var duration = ""
if (line.start) {
projectStart[line.name] = line.timestamp
} else {
warn("Couldn't determine project start: " + line.name)
val projectStart = projectStart[line.name]
if (projectStart != null) {
duration = " (" + ((line.timestamp - projectStart) / 1000)
.toInt().toString() + ")"
} else {
warn("Couldn't determine project start: " + line.name)
}
}
row.add((line.name + duration))
} else {
row.add("")
}
row.add((line.name + duration))
} else {
row.add("")
}
table.addRow(row)
}
table.addRow(row)
} else {
warn("Couldn't find historyLog")
}
}
return table