Skip to content

Commit 9e2c95d

Browse files
committed
limit_window -> rate_limit_window
1 parent eb30002 commit 9e2c95d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

notebook/notebookapp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def init_settings(self, ipython_app, kernel_manager, contents_manager,
191191
# rate limits
192192
iopub_msg_rate_limit=ipython_app.iopub_msg_rate_limit,
193193
iopub_data_rate_limit=ipython_app.iopub_data_rate_limit,
194-
limit_window=ipython_app.limit_window,
194+
rate_limit_window=ipython_app.rate_limit_window,
195195

196196
# authentication
197197
cookie_secret=ipython_app.cookie_secret,
@@ -798,7 +798,7 @@ def _notebook_dir_changed(self, name, old, new):
798798
Maximum rate at which messages can be sent on iopub before they are
799799
limited.""")
800800

801-
limit_window = Float(1.0, config=True, help="""(sec) Time window used to
801+
rate_limit_window = Float(1.0, config=True, help="""(sec) Time window used to
802802
check the message and data rate limits.""")
803803

804804
def parse_command_line(self, argv=None):

notebook/services/kernels/handlers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ def iopub_data_rate_limit(self):
110110
return self.settings.get('iopub_data_rate_limit', None)
111111

112112
@property
113-
def limit_window(self):
114-
return self.settings.get('limit_window', 1.0)
113+
def rate_limit_window(self):
114+
return self.settings.get('rate_limit_window', 1.0)
115115

116116
def __repr__(self):
117117
return "%s(%s)" % (self.__class__.__name__, getattr(self, 'kernel_id', 'uninitialized'))
@@ -303,12 +303,12 @@ def write_stderr(error_message):
303303

304304
# Queue a removal of the byte and message count for a time in the
305305
# future, when we are no longer interested in it.
306-
self._iopub_window_byte_queue.append((now + self.limit_window, byte_count))
306+
self._iopub_window_byte_queue.append((now + self.rate_limit_window, byte_count))
307307

308308
# Check the limits, set the limit flags, and reset the
309309
# message and data counts.
310-
msg_rate = float(self._iopub_window_msg_count) / self.limit_window
311-
data_rate = float(self._iopub_window_byte_count) / self.limit_window
310+
msg_rate = float(self._iopub_window_msg_count) / self.rate_limit_window
311+
data_rate = float(self._iopub_window_byte_count) / self.rate_limit_window
312312

313313
# Check the msg rate
314314
if self.iopub_msg_rate_limit is not None and msg_rate > self.iopub_msg_rate_limit and self.iopub_msg_rate_limit > 0:

0 commit comments

Comments
 (0)