Changeset View
Changeset View
Standalone View
Standalone View
swh/web/misc/coverage.py
# Copyright (C) 2018-2021 The Software Heritage developers | # Copyright (C) 2018-2021 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU Affero General Public License version 3, or any later version | # License: GNU Affero General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from collections import Counter, defaultdict | from collections import Counter, defaultdict | ||||
from functools import lru_cache | from functools import lru_cache | ||||
from typing import Dict, List, Tuple | from typing import Dict, List, Tuple | ||||
from urllib.parse import urlparse | from urllib.parse import urlparse | ||||
import sentry_sdk | import sentry_sdk | ||||
from django.conf.urls import url | from django.conf.urls import url | ||||
from django.shortcuts import render | from django.shortcuts import render | ||||
from django.views.decorators.cache import never_cache | |||||
from django.views.decorators.clickjacking import xframe_options_exempt | from django.views.decorators.clickjacking import xframe_options_exempt | ||||
from swh.scheduler.model import SchedulerMetrics | from swh.scheduler.model import SchedulerMetrics | ||||
from swh.web.common import archive | from swh.web.common import archive | ||||
from swh.web.common.utils import get_deposits_list, reverse | from swh.web.common.utils import get_deposits_list, reverse | ||||
from swh.web.config import scheduler | from swh.web.config import scheduler | ||||
_swh_arch_overview_doc = ( | _swh_arch_overview_doc = ( | ||||
▲ Show 20 Lines • Show All 270 Lines • ▼ Show 20 Lines | return reverse( | ||||
"visit_type": visit_type, | "visit_type": visit_type, | ||||
"with_visit": "true", | "with_visit": "true", | ||||
"with_content": "true", | "with_content": "true", | ||||
}, | }, | ||||
) | ) | ||||
@xframe_options_exempt | @xframe_options_exempt | ||||
@never_cache | |||||
def _swh_coverage(request): | def _swh_coverage(request): | ||||
listers_metrics = _get_listers_metrics() | listers_metrics = _get_listers_metrics() | ||||
for origins in listed_origins["origins"]: | for origins in listed_origins["origins"]: | ||||
origins["instances"] = {} | origins["instances"] = {} | ||||
origins_type = origins["type"] | origins_type = origins["type"] | ||||
# special processing for nixos/guix origins as there is no | # special processing for nixos/guix origins as there is no | ||||
# scheduler metrics for those | # scheduler metrics for those | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |