Changeset View
Changeset View
Standalone View
Standalone View
swh/web/api/views/stat.py
# Copyright (C) 2015-2019 The Software Heritage developers | # Copyright (C) 2015-2022 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 rest_framework.request import Request | |||||
from swh.web.api.apidoc import api_doc, format_docstring | from swh.web.api.apidoc import api_doc, format_docstring | ||||
from swh.web.api.apiurls import api_route | from swh.web.api.apiurls import api_route | ||||
from swh.web.common import archive | from swh.web.common import archive | ||||
@api_route(r"/stat/counters/", "api-1-stat-counters") | @api_route(r"/stat/counters/", "api-1-stat-counters") | ||||
@api_doc("/stat/counters/", noargs=True) | @api_doc("/stat/counters/", noargs=True) | ||||
@format_docstring() | @format_docstring() | ||||
def api_stats(request): | def api_stats(request: Request): | ||||
""" | """ | ||||
.. http:get:: /api/1/stat/counters/ | .. http:get:: /api/1/stat/counters/ | ||||
Get statistics about the content of the archive. | Get statistics about the content of the archive. | ||||
:>json number content: current number of content objects (aka files) | :>json number content: current number of content objects (aka files) | ||||
in the archive | in the archive | ||||
:>json number directory: current number of directory objects | :>json number directory: current number of directory objects | ||||
Show All 28 Lines |