Skip to content
Snippets Groups Projects
Commit f568912f authored by Matei Zaharia's avatar Matei Zaharia
Browse files

Merge pull request #181 from BlackNiuza/fix_tasks_number

correct number of tasks in ExecutorsUI

Index `a` is not `execId` here
parents aa638ed9 eda05fa4
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,7 @@ private[spark] class ExecutorsUI(val sc: SparkContext) {
</tr>
}
val execInfo = for (b <- 0 until storageStatusList.size) yield getExecInfo(b)
val execInfo = for (statusId <- 0 until storageStatusList.size) yield getExecInfo(statusId)
val execTable = UIUtils.listingTable(execHead, execRow, execInfo)
val content =
......@@ -99,16 +99,17 @@ private[spark] class ExecutorsUI(val sc: SparkContext) {
UIUtils.headerSparkPage(content, sc, "Executors (" + execInfo.size + ")", Executors)
}
def getExecInfo(a: Int): Seq[String] = {
val execId = sc.getExecutorStorageStatus(a).blockManagerId.executorId
val hostPort = sc.getExecutorStorageStatus(a).blockManagerId.hostPort
val rddBlocks = sc.getExecutorStorageStatus(a).blocks.size.toString
val memUsed = sc.getExecutorStorageStatus(a).memUsed().toString
val maxMem = sc.getExecutorStorageStatus(a).maxMem.toString
val diskUsed = sc.getExecutorStorageStatus(a).diskUsed().toString
val activeTasks = listener.executorToTasksActive.get(a.toString).map(l => l.size).getOrElse(0)
val failedTasks = listener.executorToTasksFailed.getOrElse(a.toString, 0)
val completedTasks = listener.executorToTasksComplete.getOrElse(a.toString, 0)
def getExecInfo(statusId: Int): Seq[String] = {
val status = sc.getExecutorStorageStatus(statusId)
val execId = status.blockManagerId.executorId
val hostPort = status.blockManagerId.hostPort
val rddBlocks = status.blocks.size.toString
val memUsed = status.memUsed().toString
val maxMem = status.maxMem.toString
val diskUsed = status.diskUsed().toString
val activeTasks = listener.executorToTasksActive.getOrElse(execId, HashSet.empty[Long]).size
val failedTasks = listener.executorToTasksFailed.getOrElse(execId, 0)
val completedTasks = listener.executorToTasksComplete.getOrElse(execId, 0)
val totalTasks = activeTasks + failedTasks + completedTasks
Seq(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment