File tree 4 files changed +24
-7
lines changed
4 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -1141,9 +1141,19 @@ properties:
1141
1141
host-cpu :
1142
1142
type : boolean
1143
1143
description : Should we include host-wide CPU usage, with very granular breakdown?
1144
- gil-contention :
1145
- type : boolean
1146
- description : Should we include GIL contention metrics, requires `gilknocker` to be installed.
1144
+ gil :
1145
+ type : object
1146
+ description : |
1147
+ Should we include GIL contention metrics, requires `gilknocker` to be installed.
1148
+ properties :
1149
+ enabled :
1150
+ type : boolean
1151
+ description : Enable monitoring of GIL contention
1152
+ interval :
1153
+ type : string
1154
+ description : |
1155
+ GIL polling interval. More frequent polling will reflect a more accurate GIL
1156
+ contention metric but will be more likely to impact runtime performance.
1147
1157
1148
1158
rmm :
1149
1159
type : object
Original file line number Diff line number Diff line change @@ -310,7 +310,9 @@ distributed:
310
310
interval : 500ms
311
311
disk : true # Monitor host-wide disk I/O
312
312
host-cpu : false # Monitor host-wide CPU usage, with very granular breakdown
313
- gil-contention : false # Monitor GIL contention
313
+ gil :
314
+ enabled : false # Monitor GIL contention
315
+ interval : " 1ms" # Frequency to poll GIL
314
316
event-loop : tornado
315
317
rmm :
316
318
pool-size : null
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ def __init__(
95
95
96
96
if monitor_gil_contention is None :
97
97
monitor_gil_contention = dask .config .get (
98
- "distributed.admin.system-monitor.gil-contention "
98
+ "distributed.admin.system-monitor.gil.enabled "
99
99
)
100
100
self .monitor_gil_contention = monitor_gil_contention
101
101
if self .monitor_gil_contention :
@@ -108,7 +108,12 @@ def __init__(
108
108
self .monitor_gil_contention = False
109
109
else :
110
110
self .quantities ["gil_contention" ] = deque (maxlen = maxlen )
111
- self ._gilknocker = KnockKnock (1_000 ) # TODO(miles) param interval?
111
+ raw_interval = dask .config .get (
112
+ "distributed.admin.system-monitor.gil.interval" ,
113
+ )
114
+ interval = dask .utils .parse_timedelta (raw_interval , default = "us" ) * 1e6
115
+
116
+ self ._gilknocker = KnockKnock (polling_interval_micros = int (interval ))
112
117
self ._gilknocker .start ()
113
118
114
119
if not WINDOWS :
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ def test_gil_contention():
109
109
a = sm .update ()
110
110
assert "gil_contention" in a
111
111
112
- with dask .config .set ({"distributed.admin.system-monitor.gil-contention " : True }):
112
+ with dask .config .set ({"distributed.admin.system-monitor.gil.enabled " : True }):
113
113
sm = SystemMonitor ()
114
114
a = sm .update ()
115
115
assert "gil_contention" in a
You can’t perform that action at this time.
0 commit comments