reach_commons 0.18.30__tar.gz → 0.18.32__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {reach_commons-0.18.30 → reach_commons-0.18.32}/PKG-INFO +1 -1
  2. {reach_commons-0.18.30 → reach_commons-0.18.32}/pyproject.toml +1 -1
  3. reach_commons-0.18.32/reach_commons/app_logging/logging_utils.py +11 -0
  4. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/reach_aws/sqs.py +14 -7
  5. {reach_commons-0.18.30 → reach_commons-0.18.32}/README.md +0 -0
  6. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/__init__.py +0 -0
  7. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/app_logging/__init__.py +0 -0
  8. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/app_logging/http_logger.py +0 -0
  9. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/app_logging/log_deprecated_endpoints.py +0 -0
  10. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/app_logging/logger.py +0 -0
  11. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/app_logging/logging_config.py +0 -0
  12. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/clients/__init__.py +0 -0
  13. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/clients/event_processor.py +0 -0
  14. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/clients/hubspot.py +0 -0
  15. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/clients/outscraper.py +0 -0
  16. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/clients/reach_data_bridge.py +0 -0
  17. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/clients/reach_ops_api.py +0 -0
  18. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/mongo/__init__.py +0 -0
  19. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/mongo/customer_persistence.py +0 -0
  20. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/mongo/customer_persistence_async.py +0 -0
  21. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/mongo/validation/__init__.py +0 -0
  22. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/reach_aws/__init__.py +0 -0
  23. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/reach_aws/commons.py +0 -0
  24. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/reach_aws/dynamo_db.py +0 -0
  25. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/reach_aws/exceptions.py +0 -0
  26. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/reach_aws/firehose.py +0 -0
  27. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/reach_aws/kms.py +0 -0
  28. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/reach_aws/s3.py +0 -0
  29. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/reach_base_model.py +0 -0
  30. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/redis_manager.py +0 -0
  31. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/sms_smart_encoding.py +0 -0
  32. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/utils.py +0 -0
  33. {reach_commons-0.18.30 → reach_commons-0.18.32}/reach_commons/validations.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reach_commons
3
- Version: 0.18.30
3
+ Version: 0.18.32
4
4
  Summary: Reach Commons is a versatile utility library designed to streamline and enhance development workflows within the Reach ecosystem.
5
5
  License: MIT
6
6
  Author: Engineering
@@ -1,7 +1,7 @@
1
1
  # isort .; black .; poetry build; poetry publish
2
2
  [tool.poetry]
3
3
  name = "reach_commons"
4
- version = "0.18.30"
4
+ version = "0.18.32"
5
5
  description = "Reach Commons is a versatile utility library designed to streamline and enhance development workflows within the Reach ecosystem."
6
6
  authors = ["Engineering <engineering@getreach.ai>"]
7
7
  license = "MIT"
@@ -0,0 +1,11 @@
1
+ import logging
2
+ import os
3
+
4
+
5
+ def init_logger(name: str):
6
+ logging.basicConfig(
7
+ level=getattr(logging, os.getenv("LOG_LEVEL", "INFO").upper(), logging.INFO),
8
+ format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
9
+ force=True,
10
+ )
11
+ return logging.getLogger(name)
@@ -219,25 +219,29 @@ class SQSClient(BaseSQSClient):
219
219
  in_flight = metrics["in_flight"]
220
220
  delayed = metrics["delayed"]
221
221
 
222
- total_active = visible + in_flight
222
+ logical_visible = visible + delayed
223
223
 
224
- over_visible = visible >= max_visible_capacity
224
+ total_messages = visible + in_flight + delayed
225
+
226
+ over_visible = logical_visible >= max_visible_capacity
225
227
  over_total = (
226
- max_total_capacity is not None and total_active >= max_total_capacity
228
+ max_total_capacity is not None and total_messages >= max_total_capacity
227
229
  )
228
230
 
229
231
  if over_visible or over_total:
230
232
  self.logger.warning(
231
233
  (
232
234
  "queue_over_capacity, topic_name=%s, "
233
- "visible=%s, in_flight=%s, delayed=%s,"
234
- "total_active=%s, max_visible_capacity=%s, max_total_capacity=%s"
235
+ "visible=%s, in_flight=%s, delayed=%s, "
236
+ "logical_visible=%s, total_messages=%s, "
237
+ "max_visible_capacity=%s, max_total_capacity=%s"
235
238
  ),
236
239
  self.topic_name,
237
240
  visible,
238
241
  in_flight,
239
242
  delayed,
240
- total_active,
243
+ logical_visible,
244
+ total_messages,
241
245
  max_visible_capacity,
242
246
  max_total_capacity,
243
247
  )
@@ -246,6 +250,8 @@ class SQSClient(BaseSQSClient):
246
250
  "visible_count": visible,
247
251
  "in_flight_count": in_flight,
248
252
  "delayed_count": delayed,
253
+ "logical_visible": logical_visible,
254
+ "total_messages": total_messages,
249
255
  "max_visible_capacity": max_visible_capacity,
250
256
  "max_total_capacity": max_total_capacity,
251
257
  }
@@ -261,7 +267,8 @@ class SQSClient(BaseSQSClient):
261
267
  "visible_count": visible,
262
268
  "in_flight_count": in_flight,
263
269
  "delayed_count": delayed,
264
- "oldest_age_seconds": oldest_age_seconds,
270
+ "logical_visible": logical_visible,
271
+ "total_messages": total_messages,
265
272
  "max_visible_capacity": max_visible_capacity,
266
273
  "max_total_capacity": max_total_capacity,
267
274
  }