From 3e9e1ecb295294459e306c2b29204fb262774b21 Mon Sep 17 00:00:00 2001 From: Keyur Date: Fri, 17 Nov 2023 15:42:33 -0800 Subject: [PATCH] #186450397 #186127421 Refactor: Event queue size config option default to 1M (#81) Refactor: Event queue size config option default to 1M Refactor: Bump moesifpythonrequest to version 0.3.2 Refactor: Update README.md Bump version to 2.3.5 --- README.md | 2 +- moesifdjango/middleware.py | 2 +- moesifdjango/middleware_pre19.py | 2 +- requirements.txt | 2 +- setup.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ef693a2..00cd8f9 100755 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ to add custom metadata that will be associated with the event. The metadata must (optional) __int__, default 25, Maximum batch size when sending to Moesif. #### __`EVENT_QUEUE_SIZE`__ -(optional) __int__, default 10000, Maximum number of events to hold in queue before sending to Moesif. In case of network issues when not able to connect/send event to Moesif, skips adding new to event to queue to prevent memory overflow. +(optional) __int__, default 1000000, Maximum number of events to hold in queue before sending to Moesif. In case of network issues when not able to connect/send event to Moesif, skips adding new to event to queue to prevent memory overflow. #### __`AUTHORIZATION_HEADER_NAME`__ (optional) _string_, A request header field name used to identify the User in Moesif. Default value is `authorization`. Also, supports a comma separated string. We will check headers in order like `"X-Api-Key,Authorization"`. diff --git a/moesifdjango/middleware.py b/moesifdjango/middleware.py index aa9758f..c734594 100644 --- a/moesifdjango/middleware.py +++ b/moesifdjango/middleware.py @@ -88,7 +88,7 @@ def __init__(self, get_response): self.rules_etag = None self.last_updated_time = datetime.utcnow() self._reset_scheduler() - self.event_queue_size = self.middleware_settings.get('EVENT_QUEUE_SIZE', 10000) + self.event_queue_size = self.middleware_settings.get('EVENT_QUEUE_SIZE', 1000000) self.mo_events_queue = queue.Queue(maxsize=self.event_queue_size) self.event_batch_size = self.middleware_settings.get('BATCH_SIZE', 25) try: diff --git a/moesifdjango/middleware_pre19.py b/moesifdjango/middleware_pre19.py index 61922da..bf7dd46 100644 --- a/moesifdjango/middleware_pre19.py +++ b/moesifdjango/middleware_pre19.py @@ -73,7 +73,7 @@ def __init__(self): self.config_etag = None self.last_updated_time = datetime.utcnow() self._reset_scheduler() - self.event_queue_size = self.middleware_settings.get('EVENT_QUEUE_SIZE', 10000) + self.event_queue_size = self.middleware_settings.get('EVENT_QUEUE_SIZE', 1000000) self.mo_events_queue = queue.Queue(maxsize=self.event_queue_size) self.event_batch_size = self.middleware_settings.get('BATCH_SIZE', 25) diff --git a/requirements.txt b/requirements.txt index 51aa279..04b5782 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,5 @@ nose==1.3.7 isodatetimehandler==1.0.2 moesifapi==1.4.1 celery>=3.1.25 -moesifpythonrequest==0.3.0 +moesifpythonrequest==0.3.2 apscheduler==3.6.1 diff --git a/setup.py b/setup.py index 39a7782..99a3683 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='2.3.4', + version='2.3.5', description='Moesif Middleware for Python Django', long_description=long_description,