def resource_fn()

in realbook/callbacks/utilization.py [0:0]


    def resource_fn(self) -> float:
        mem_stats = psutil.virtual_memory()
        # Don't use used as the psutil docs say that
        # "total - free does not necessarily match used."
        return (1.0 - float(mem_stats.available) / float(mem_stats.total)) * 100.0