@@ -956,30 +956,21 @@ def test_runtime_get_count(self, mock_gc_get_count):
956
956
f"process.runtime.{ self .implementation } .gc_count" ,
957
957
expected_gc_count ,
958
958
)
959
- expected_gc_collections = [
960
- _SystemMetricsResult ({"generation" : "0" }, 1 ),
961
- _SystemMetricsResult ({"generation" : "1" }, 2 ),
962
- _SystemMetricsResult ({"generation" : "2" }, 3 ),
963
- ]
964
- self ._test_metrics (
965
- "cpython.gc.collections" ,
966
- expected_gc_collections ,
967
- )
968
959
969
960
@mock .patch ("gc.get_count" )
970
961
@skipIf (
971
962
python_implementation ().lower () == "pypy" , "not supported for pypy"
972
963
)
973
- def test_runtime_get_count (self , mock_gc_get_count ):
964
+ def test_runtime_get_gc_collections (self , mock_gc_get_count ):
974
965
mock_gc_get_count .configure_mock (** {"return_value" : (1 , 2 , 3 )})
975
-
976
- expected = [
977
- _SystemMetricsResult ({"count" : "0" }, 1 ),
978
- _SystemMetricsResult ({"count" : "1" }, 2 ),
979
- _SystemMetricsResult ({"count" : "2" }, 3 ),
966
+ expected_gc_collections = [
967
+ _SystemMetricsResult ({"generation" : "0" }, 1 ),
968
+ _SystemMetricsResult ({"generation" : "1" }, 2 ),
969
+ _SystemMetricsResult ({"generation" : "2" }, 3 ),
980
970
]
981
971
self ._test_metrics (
982
- f"process.runtime.{ self .implementation } .gc_count" , expected
972
+ "cpython.gc.collections" ,
973
+ expected_gc_collections ,
983
974
)
984
975
985
976
@mock .patch ("psutil.Process.num_ctx_switches" )
0 commit comments