Skip to content

Commit

Permalink
Fix bug in blocked counts
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Nov 22, 2023
1 parent 5dd30c4 commit 672519a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion oonidata/fastapi/routers/aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class AggregationEntry(BaseModel):
loni_down_map: Dict[str, float]
loni_down_value: float
loni_blocked_map: Dict[str, float]
loni_blocked_value: float

Check warning on line 56 in oonidata/fastapi/routers/aggregation.py

View check run for this annotation

Codecov / codecov/patch

oonidata/fastapi/routers/aggregation.py#L50-L56

Added lines #L50 - L56 were not covered by tests
# loni_ok_map: Dict[str, float]
loni_ok_value: float

Check warning on line 58 in oonidata/fastapi/routers/aggregation.py

View check run for this annotation

Codecov / codecov/patch

oonidata/fastapi/routers/aggregation.py#L58

Added line #L58 was not covered by tests

Expand Down Expand Up @@ -246,7 +247,7 @@ async def get_aggregation(
(k, v) -> (
k,
if(
loni_blocked_cnt_total == 0 or loni_blocked_cnt[k], 0,
loni_blocked_cnt_total == 0 or loni_blocked_cnt[k] == 0, 0,
v / loni_blocked_cnt[k] * loni_blocked_value_total/loni_blocked_cnt_total
)
),
Expand Down

0 comments on commit 672519a

Please sign in to comment.