From 8712493c4ec9cabfeaee579215c197fa4b4cd537 Mon Sep 17 00:00:00 2001 From: Michael Whittaker Date: Thu, 4 Feb 2021 11:40:31 -0800 Subject: [PATCH] Fixed buggy capacity computation. Need to re-run things to make the numbers are right still. --- quorums/quorum_system.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quorums/quorum_system.py b/quorums/quorum_system.py index 8c86949..94e2808 100644 --- a/quorums/quorum_system.py +++ b/quorums/quorum_system.py @@ -642,7 +642,8 @@ class Strategy(Generic[T]): def capacity(self, read_fraction: Optional[Distribution] = None, write_fraction: Optional[Distribution] = None) -> float: - return 1 / self.load(read_fraction, write_fraction) + d = distribution.canonicalize_rw(read_fraction, write_fraction) + return sum(p * 1 / self._load(fr) for (fr, p) in d.items()) def network_load(self, read_fraction: Optional[Distribution] = None,