Skip to content

Commit

Permalink
Merge pull request #17 from Moesif/refactor-update-dependencies
Browse files Browse the repository at this point in the history
#186127421 #186450397 Refactor: Bump moesifpythonrequest to version 0.3.2
  • Loading branch information
keyur9 authored Nov 17, 2023
2 parents b0894a4 + ea060ce commit 98cd5f9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ to associate this event with custom metadata. For example, you may want to save
#### __`BATCH_SIZE`__
(optional) __int__, default 25, Maximum batch size when sending events to Moesif.

#### __`EVENT_QUEUE_SIZE`__
(optional) __int__, default 1000000, the maximum number of event objects queued in memory pending upload to Moesif. If the queue is full additional calls to `MoesifMiddleware` will return immediately without logging the event, so this number should be set based on the expected event size and memory capacity

#### __`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"`.

Expand Down
5 changes: 3 additions & 2 deletions moesifasgi/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, settings=None, *args, **kwargs):
self.DEBUG = self.moesif_settings.get('DEBUG', False)
if self.DEBUG:
Configuration.BASE_URI = self.moesif_settings.get('BASE_URI', 'https://api.moesif.net')
Configuration.version = 'moesifasgi-python/0.1.4'
Configuration.version = 'moesifasgi-python/0.1.5'
if self.moesif_settings.get('CAPTURE_OUTGOING_REQUESTS', False):
try:
if self.DEBUG:
Expand All @@ -56,7 +56,8 @@ def __init__(self, settings=None, *args, **kwargs):
self.sampling_percentage = 100
self.last_updated_time = datetime.utcnow()
self.disable_transaction_id = self.moesif_settings.get('DISABLED_TRANSACTION_ID', False)
self.moesif_events_queue = queue.Queue()
self.event_queue_size = self.middleware_settings.get('EVENT_QUEUE_SIZE', 1000000)
self.moesif_events_queue = queue.Queue(maxsize=self.event_queue_size)
self.BATCH_SIZE = self.moesif_settings.get('BATCH_SIZE', 25)
self.last_event_job_run_time = datetime(1970, 1, 1, 0, 0) # Assuming job never ran, set it to epoch start time
self.scheduler = None
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nose==1.3.7
moesifapi==1.4.0
moesifpythonrequest==0.2.0
moesifpythonrequest==0.3.2
starlette==0.16.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='0.1.4',
version='0.1.5',

description='Moesif Middleware for Python ASGI based platforms (FastAPI & Others)',
long_description=long_description,
Expand Down

0 comments on commit 98cd5f9

Please sign in to comment.