We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f63265 commit 9168819Copy full SHA for 9168819
django_prometheus/db/common.py
@@ -63,16 +63,18 @@ class CursorWrapper(cursor_class):
63
64
def execute(self, *args, **kwargs):
65
execute_total.labels(alias, vendor).inc()
66
- with query_duration_seconds.labels(**labels).time(), ExceptionCounterByType(
67
- errors_total, extra_labels=labels
+ with (
+ query_duration_seconds.labels(**labels).time(),
68
+ ExceptionCounterByType(errors_total, extra_labels=labels),
69
):
70
return super().execute(*args, **kwargs)
71
72
def executemany(self, query, param_list, *args, **kwargs):
73
execute_total.labels(alias, vendor).inc(len(param_list))
74
execute_many_total.labels(alias, vendor).inc(len(param_list))
75
76
77
78
79
return super().executemany(query, param_list, *args, **kwargs)
80
django_prometheus/tests/end2end/testapp/test_caches.py
@@ -6,6 +6,7 @@
6
7
_SUPPORTED_CACHES = ["memcached.PyLibMCCache", "memcached.PyMemcacheCache", "filebased", "locmem", "native_redis"]
8
9
+
10
class TestCachesMetrics:
11
"""Test django_prometheus.caches metrics."""
12
@@ -33,7 +34,7 @@ def test_counters(self, supported_cache):
33
34
35
def test_redis_cache_fail(self):
36
# Note: test use fake service config (like if server was stopped)
- supported_cache = "native_redis"
37
+ supported_cache = "redis"
38
total_before = get_metric("django_cache_get_total", backend=supported_cache) or 0
39
fail_before = get_metric("django_cache_get_fail_total", backend=supported_cache) or 0
40
hit_before = get_metric("django_cache_get_hits_total", backend=supported_cache) or 0
0 commit comments