File: metrics.py

package info (click to toggle)
django-prometheus 2.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 568 kB
  • sloc: python: 1,776; sh: 5; makefile: 3
file content (28 lines) | stat: -rw-r--r-- 677 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from prometheus_client import Counter

from django_prometheus.conf import NAMESPACE

django_cache_get_total = Counter(
    "django_cache_get_total",
    "Total get requests on cache",
    ["backend"],
    namespace=NAMESPACE,
)
django_cache_hits_total = Counter(
    "django_cache_get_hits_total",
    "Total hits on cache",
    ["backend"],
    namespace=NAMESPACE,
)
django_cache_misses_total = Counter(
    "django_cache_get_misses_total",
    "Total misses on cache",
    ["backend"],
    namespace=NAMESPACE,
)
django_cache_get_fail_total = Counter(
    "django_cache_get_fail_total",
    "Total get request failures by cache",
    ["backend"],
    namespace=NAMESPACE,
)