Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/10154#discussion_r46759338
--- Diff: core/src/main/scala/org/apache/spark/ui/exec/ExecutorsPage.scala
---
@@ -117,6 +119,28 @@ private[ui] class ExecutorsPage(
val maximumMemory = info.maxMemory
val memoryUsed = info.memoryUsed
val diskUsed = info.diskUsed
+
+ // Determine Color Opacity from 0.5-1
+ var activeTasksAlpha = 1.0
+ var failedTasksAlpha = 1.0
+ var completedTasksAlpha = 1.0
+ var totalDurationAlpha = 1.0
+ if (info.totalCores > 0) {
+ // activeTasks range from 0 to all cores
+ activeTasksAlpha = (info.activeTasks.toDouble / info.totalCores) *
0.5 + 0.5
+ }
+ if (info.totalTasks > 0) {
--- End diff --
You can also assign these like
```
val (failedTasksAlpha, completedTasksAlpha) =
if (...) {
(..., ...)
} else {
(1.0, 1.0)
}
```
but whether that's clearer is a matter of taste.
It might be better to cap alpha at 1.0 just for tidiness.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]