diff --git a/lib/galaxy/job_metrics/instrumenters/hostname.py b/lib/galaxy/job_metrics/instrumenters/hostname.py index 721fa1aca419..d4d01402a879 100644 --- a/lib/galaxy/job_metrics/instrumenters/hostname.py +++ b/lib/galaxy/job_metrics/instrumenters/hostname.py @@ -1,6 +1,7 @@ """The module describes the ``hostname`` job metrics plugin.""" import logging +from typing import Any from . import InstrumentPlugin from .. import formatting @@ -9,8 +10,8 @@ class HostnameFormatter(formatting.JobMetricFormatter): - def format(self, key, value): - return key, value + def format(self, key: str, value: Any): + return formatting.FormattedMetric(key, value) class HostnamePlugin(InstrumentPlugin): diff --git a/lib/galaxy/job_metrics/instrumenters/meminfo.py b/lib/galaxy/job_metrics/instrumenters/meminfo.py index 80e523d97308..a6ec359e730a 100644 --- a/lib/galaxy/job_metrics/instrumenters/meminfo.py +++ b/lib/galaxy/job_metrics/instrumenters/meminfo.py @@ -1,6 +1,7 @@ """The module describes the ``meminfo`` job metrics plugin.""" import re +from typing import Any from galaxy import util from . import InstrumentPlugin @@ -14,9 +15,9 @@ class MemInfoFormatter(formatting.JobMetricFormatter): - def format(self, key, value): + def format(self, key: str, value: Any): title = MEMINFO_TITLES.get(key, key) - return title, util.nice_size(value * 1000) # kB = *1000, KB = *1024 - wikipedia + return formatting.FormattedMetric(title, util.nice_size(value * 1000)) # kB = *1000, KB = *1024 - wikipedia class MemInfoPlugin(InstrumentPlugin):