Repository: dask/distributed

Issue:
Dashboard histogram on "memory usage" doesn't have helpful x-ticks
**Describe the bug**

When the distributed has many workers available, the dashboard page `/status` shows a histogram of the memory usage of each workers:

<img width="265" alt="Screen Shot 2020-03-17 at 10 33 18 AM" src="https://user-images.githubusercontent.com/1320475/76872664-a3106380-6864-11ea-9994-3a1724fd28fb.png">

This graph is not useful to me because it has one tick mark, `0.0`. To see the memory usage of the workers, I have to go to `/workers` and manually parse out the (approximate) maximum memory usage to get an idea of the histogram scale:

<details>
<img width="821" alt="Screen Shot 2020-03-17 at 10 32 27 AM" src="https://user-images.githubusercontent.com/1320475/76872619-9429b100-6864-11ea-9e19-25b2692c792e.png">
</details>

**Expected Results**

I'd like to see at least one other tick mark besides `0.0`. I'd be fine with the maximum usage displaying.

This matters to me because I think I had a `KilledWorker` error because of an out-of-memory error.

**Versions**

* distributed: 2.11.0




Discussion:

Resolving patch:
diff --git a/distributed/dashboard/components/nvml.py b/distributed/dashboard/components/nvml.py
--- a/distributed/dashboard/components/nvml.py
+++ b/distributed/dashboard/components/nvml.py
@@ -14,7 +14,7 @@
 from tornado import escape
 from dask.utils import format_bytes
 from distributed.utils import log_errors
-from distributed.dashboard.components.scheduler import BOKEH_THEME
+from distributed.dashboard.components.scheduler import BOKEH_THEME, TICKS_1024
 from distributed.dashboard.utils import without_property_validation, update
 
 
@@ -83,7 +83,7 @@ def __init__(self, scheduler, width=600, **kwargs):
             )
             rect.nonselection_glyph = None
 
-            memory.axis[0].ticker = BasicTicker(mantissas=[1, 256, 512], base=1024)
+            memory.axis[0].ticker = BasicTicker(**TICKS_1024)
             memory.xaxis[0].formatter = NumeralTickFormatter(format="0.0 b")
             memory.xaxis.major_label_orientation = -math.pi / 12
             memory.x_range.start = 0
diff --git a/distributed/dashboard/components/scheduler.py b/distributed/dashboard/components/scheduler.py
--- a/distributed/dashboard/components/scheduler.py
+++ b/distributed/dashboard/components/scheduler.py
@@ -78,6 +78,7 @@
 )
 
 BOKEH_THEME = Theme(os.path.join(os.path.dirname(__file__), "..", "theme.yaml"))
+TICKS_1024 = {"base": 1024, "mantissas": [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]}
 
 nan = float("nan")
 inf = float("inf")
@@ -233,7 +234,7 @@ def __init__(self, scheduler, **kwargs):
             )
 
             self.root.xaxis[0].formatter = NumeralTickFormatter(format="0.0 b")
-            self.root.xaxis.ticker = AdaptiveTicker(mantissas=[1, 256, 512], base=1024)
+            self.root.xaxis.ticker = AdaptiveTicker(**TICKS_1024)
             self.root.xaxis.major_label_orientation = -math.pi / 12
 
             self.root.xaxis.minor_tick_line_alpha = 0
@@ -296,7 +297,7 @@ def __init__(self, scheduler, **kwargs):
             )
             fig.x_range.start = 0
             fig.xaxis[0].formatter = NumeralTickFormatter(format="0.0 b")
-            fig.xaxis.ticker = AdaptiveTicker(mantissas=[1, 256, 512], base=1024)
+            fig.xaxis.ticker = AdaptiveTicker(**TICKS_1024)
             rect.nonselection_glyph = None
 
             fig.xaxis.minor_tick_line_alpha = 0
@@ -379,9 +380,7 @@ def __init__(self, scheduler, **kwargs):
                 location=(0, 0),
             )
             color_bar.formatter = NumeralTickFormatter(format="0.0 b")
-            color_bar.ticker = AdaptiveTicker(
-                mantissas=[1, 64, 128, 256, 512], base=1024
-            )
+            color_bar.ticker = AdaptiveTicker(**TICKS_1024)
             fig.add_layout(color_bar, "right")
 
             fig.toolbar.logo = None
@@ -464,7 +463,7 @@ def __init__(self, scheduler, **kwargs):
                 source=self.source, x="name", top="nbytes", width=0.9, color="color"
             )
             fig.yaxis[0].formatter = NumeralTickFormatter(format="0.0 b")
-            fig.yaxis.ticker = AdaptiveTicker(mantissas=[1, 256, 512], base=1024)
+            fig.yaxis.ticker = AdaptiveTicker(**TICKS_1024)
             fig.xaxis.major_label_orientation = -math.pi / 12
             rect.nonselection_glyph = None
 
@@ -593,7 +592,7 @@ def __init__(self, scheduler, width=600, **kwargs):
             )
             rect.nonselection_glyph = None
 
-            nbytes.axis[0].ticker = BasicTicker(mantissas=[1, 256, 512], base=1024)
+            nbytes.axis[0].ticker = BasicTicker(**TICKS_1024)
             nbytes.xaxis[0].formatter = NumeralTickFormatter(format="0.0 b")
             nbytes.xaxis.major_label_orientation = -math.pi / 12
             nbytes.x_range.start = 0


Test patch: