Skip to content

Commit

Permalink
There is no need to shorten the count key
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Jan 15, 2025
1 parent 038d6ff commit fd10372
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class DBStats(BaseModel):


class Loni(BaseModel):
cnt: int
count: int
dns_isp_blocked: float
dns_isp_down: float
dns_isp_ok: float
Expand Down Expand Up @@ -183,7 +183,7 @@ async def get_aggregation_analysis(
for row in rows:
d = dict(zip(list(extra_cols.keys()) + fixed_cols, row))
loni = Loni(
cnt=d.get("cnt", 0),
count=d.get("count", 0),
dns_isp_blocked=d.get("dns_isp_blocked", 0.0),
dns_isp_down=d.get("dns_isp_down", 0.0),
dns_isp_ok=d.get("dns_isp_ok", 0.0),
Expand Down
4 changes: 2 additions & 2 deletions ooniapi/services/oonimeasurements/src/oonimeasurements/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def format_aggregate_query(extra_cols: Dict[str, str], where: str):
SELECT
{",".join(extra_cols.keys())},
probe_analysis,
cnt,
count,
if(dns_isp_total = 0, NULL, dns_isp_blocked_sum_total / dns_isp_total) as dns_isp_blocked,
if(dns_isp_total = 0, NULL, dns_isp_down_sum_total / dns_isp_total) as dns_isp_down,
Expand Down Expand Up @@ -216,7 +216,7 @@ def format_aggregate_query(extra_cols: Dict[str, str], where: str):
) as dns_failure
SELECT
{",".join(extra_cols.values())},
COUNT() as cnt,
COUNT() as count,
anyHeavy(top_probe_analysis) as probe_analysis,
Expand Down

0 comments on commit fd10372

Please sign in to comment.