diff --git a/distributed/dashboard/components/shared.py b/distributed/dashboard/components/shared.py index 957dc0cf9b3..48f3c3df5df 100644 --- a/distributed/dashboard/components/shared.py +++ b/distributed/dashboard/components/shared.py @@ -2,7 +2,6 @@ import asyncio import weakref -from statistics import mean import tlz as toolz from bokeh.core.properties import without_property_validation @@ -559,6 +558,9 @@ def get_data(self): @without_property_validation @log_errors def update(self): + def mean(x): + return sum(x) / len(x) + self.source.stream(self.get_data(), 1000) self.label_source.data["cpu"] = [ "{}: {:.1f}%".format(f.__name__, f(self.source.data["cpu"]))