From 9e2c95dc0774c86a93b614d584bf9dc2ac224472 Mon Sep 17 00:00:00 2001 From: Jonathan Frederic Date: Mon, 18 Jan 2016 10:41:21 -0800 Subject: [PATCH] limit_window -> rate_limit_window --- notebook/notebookapp.py | 4 ++-- notebook/services/kernels/handlers.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index cb0313b7c..8ec62b4c1 100644 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -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): diff --git a/notebook/services/kernels/handlers.py b/notebook/services/kernels/handlers.py index 1f20bb602..fa7a9283b 100644 --- a/notebook/services/kernels/handlers.py +++ b/notebook/services/kernels/handlers.py @@ -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: