File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
django_prometheus/tests/end2end/testapp Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,29 @@ def testCounters(self):
62
62
>= 200
63
63
)
64
64
65
+ def testHistograms (self ):
66
+ cursor_db1 = connections ["test_db_1" ].cursor ()
67
+ cursor_db2 = connections ["test_db_2" ].cursor ()
68
+ cursor_db1 .execute ("SELECT 1" )
69
+ for _ in range (200 ):
70
+ cursor_db2 .execute ("SELECT 2" )
71
+ assert (
72
+ self .getMetric (
73
+ "django_db_query_duration_seconds_count" ,
74
+ alias = "test_db_1" ,
75
+ vendor = "sqlite" ,
76
+ )
77
+ > 0
78
+ )
79
+ assert (
80
+ self .getMetric (
81
+ "django_db_query_duration_seconds_count" ,
82
+ alias = "test_db_2" ,
83
+ vendor = "sqlite" ,
84
+ )
85
+ >= 200
86
+ )
87
+
65
88
def testExecuteMany (self ):
66
89
registry = self .saveRegistry ()
67
90
cursor_db1 = connections ["test_db_1" ].cursor ()
You can’t perform that action at this time.
0 commit comments