File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -17,4 +17,11 @@ public function getMetrics(): \stdClass
1717
1818 return $ this ->arangoClient ->request ('get ' , $ uri );
1919 }
20+
21+ public function getCurrentConnections (): int
22+ {
23+ $ metrics = $ this ->getMetrics ();
24+
25+ return $ metrics ->arangodb_http1_connections_total ->value + $ metrics ->arangodb_http2_connections_total ->value ;
26+ }
2027}
Original file line number Diff line number Diff line change 7474 $ result = $ prometheus ->parseText ($ rawMetrics );
7575 expect ($ result ->arangodb_aql_local_query_memory_limit_reached_total ->timestamp )->toEqual (2211753600 );
7676});
77+
78+ test ('getCurrentConnections ' , function () {
79+ $ result = $ this ->arangoClient ->monitor ()->getCurrentConnections ();
80+
81+ expect ($ result )->toBeInt ();
82+ expect ($ result )->toBeGreaterThan (0 );
83+ });
You can’t perform that action at this time.
0 commit comments