Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 63056ef7 authored by Jerome Touvier's avatar Jerome Touvier
Browse files

fix seedlink request

parent a9b63a27
Pipeline #53053 passed with stage
in 1 minute and 2 seconds
...@@ -82,13 +82,13 @@ def sql_request(params): ...@@ -82,13 +82,13 @@ def sql_request(params):
s = f"SELECT extract(year from date)::INTEGER as year, country, sum(requests)::BIGINT FROM {table}" s = f"SELECT extract(year from date)::INTEGER as year, country, sum(requests)::BIGINT FROM {table}"
elif params["request"] == "country": elif params["request"] == "country":
if "all" in params["country"]: if "all" in params["country"]:
s = f"SELECT sum(requests)::BIGINT, sum(hll_cardinality(clients))::INTEGER FROM {table}" s = f"SELECT sum(requests)::BIGINT, hll_cardinality(hll_union_agg(clients))::INTEGER FROM {table}"
else: else:
s = f"SELECT country, sum(requests)::BIGINT, sum(hll_cardinality(clients))::INTEGER FROM {table}" s = f"SELECT country, sum(requests)::BIGINT, hll_cardinality(hll_union_agg(clients))::INTEGER FROM {table}"
elif params["request"] == "send": elif params["request"] == "send":
s = f"SELECT sum(bytes)::BIGINT FROM {table}" s = f"SELECT sum(bytes)::BIGINT FROM {table}"
elif params["request"] == "timeseries": elif params["request"] == "timeseries":
s = f"SELECT date, country, sum(bytes)::BIGINT, sum(hll_cardinality(clients))::INTEGER FROM {table}" s = f"SELECT date, country, sum(bytes)::BIGINT, hll_cardinality(hll_union_agg(clients))::INTEGER FROM {table}"
s = sql_common_string(params, s) s = sql_common_string(params, s)
if "all" not in params["country"]: if "all" not in params["country"]:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment