mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Fix NPE.
This commit is contained in:
parent
75dda87fdd
commit
ba70a27968
1 changed files with 24 additions and 20 deletions
|
@ -341,31 +341,35 @@ class DynamicGraphExecutor<T>(val graph : DynamicGraph<T>, val factory: IThreadW
|
||||||
|
|
||||||
fun displayRegularLog(table: AsciiTable.Builder) : AsciiTable.Builder {
|
fun displayRegularLog(table: AsciiTable.Builder) : AsciiTable.Builder {
|
||||||
if (historyLog.any()) {
|
if (historyLog.any()) {
|
||||||
val start = historyLog[0].timestamp
|
if (historyLog[0] != null) {
|
||||||
val projectStart = ConcurrentHashMap<String, Long>()
|
val start = historyLog[0].timestamp
|
||||||
historyLog.forEach { line ->
|
val projectStart = ConcurrentHashMap<String, Long>()
|
||||||
val row = arrayListOf<String>()
|
historyLog.forEach { line ->
|
||||||
row.add(toSeconds(line.timestamp - start))
|
val row = arrayListOf<String>()
|
||||||
threadIds.keys.forEach {
|
row.add(toSeconds(line.timestamp - start))
|
||||||
if (line.threadId == it) {
|
threadIds.keys.forEach {
|
||||||
var duration = ""
|
if (line.threadId == it) {
|
||||||
if (line.start) {
|
var duration = ""
|
||||||
projectStart[line.name] = line.timestamp
|
if (line.start) {
|
||||||
} else {
|
projectStart[line.name] = line.timestamp
|
||||||
val projectStart = projectStart[line.name]
|
|
||||||
if (projectStart != null) {
|
|
||||||
duration = " (" + ((line.timestamp - projectStart) / 1000)
|
|
||||||
.toInt().toString() + ")"
|
|
||||||
} else {
|
} 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
|
return table
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue