Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9125782
metrics.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
712 B
Subscribers
None
metrics.py
View Options
# Copyright (C) 2019 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
from
prometheus_client.exposition
import
CONTENT_TYPE_LATEST
,
generate_latest
from
django.http
import
HttpResponse
from
swh.web.common.origin_save
import
compute_save_requests_metrics
from
swh.web.common.utils
import
SWH_WEB_METRICS_REGISTRY
def
prometheus_metrics
(
request
):
compute_save_requests_metrics
()
return
HttpResponse
(
content
=
generate_latest
(
registry
=
SWH_WEB_METRICS_REGISTRY
),
content_type
=
CONTENT_TYPE_LATEST
,
)
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Sat, Jun 21, 9:20 PM (4 w, 22 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3296487
Attached To
R65 Staging repository
Event Timeline
Log In to Comment