limit_window -> rate_limit_window

This commit is contained in:
Jonathan Frederic 2016-01-18 10:41:21 -08:00
parent eb30002a82
commit 9e2c95dc07
2 changed files with 7 additions and 7 deletions

View File

@ -191,7 +191,7 @@ class NotebookWebApplication(web.Application):
# rate limits
iopub_msg_rate_limit=ipython_app.iopub_msg_rate_limit,
iopub_data_rate_limit=ipython_app.iopub_data_rate_limit,
limit_window=ipython_app.limit_window,
rate_limit_window=ipython_app.rate_limit_window,
# authentication
cookie_secret=ipython_app.cookie_secret,
@ -798,7 +798,7 @@ class NotebookApp(JupyterApp):
Maximum rate at which messages can be sent on iopub before they are
limited.""")
limit_window = Float(1.0, config=True, help="""(sec) Time window used to
rate_limit_window = Float(1.0, config=True, help="""(sec) Time window used to
check the message and data rate limits.""")
def parse_command_line(self, argv=None):

View File

@ -110,8 +110,8 @@ class ZMQChannelsHandler(AuthenticatedZMQStreamHandler):
return self.settings.get('iopub_data_rate_limit', None)
@property
def limit_window(self):
return self.settings.get('limit_window', 1.0)
def rate_limit_window(self):
return self.settings.get('rate_limit_window', 1.0)
def __repr__(self):
return "%s(%s)" % (self.__class__.__name__, getattr(self, 'kernel_id', 'uninitialized'))
@ -303,12 +303,12 @@ class ZMQChannelsHandler(AuthenticatedZMQStreamHandler):
# Queue a removal of the byte and message count for a time in the
# future, when we are no longer interested in it.
self._iopub_window_byte_queue.append((now + self.limit_window, byte_count))
self._iopub_window_byte_queue.append((now + self.rate_limit_window, byte_count))
# Check the limits, set the limit flags, and reset the
# message and data counts.
msg_rate = float(self._iopub_window_msg_count) / self.limit_window
data_rate = float(self._iopub_window_byte_count) / self.limit_window
msg_rate = float(self._iopub_window_msg_count) / self.rate_limit_window
data_rate = float(self._iopub_window_byte_count) / self.rate_limit_window
# Check the msg rate
if self.iopub_msg_rate_limit is not None and msg_rate > self.iopub_msg_rate_limit and self.iopub_msg_rate_limit > 0: