Releases: azutoolkit/joobq
Releases · azutoolkit/joobq
v0.4.1
Full Changelog: v0.4.0...v0.4.1
Release Notes
We are pleased to announce significant improvements and refactorings to the Queue(T)
class and related components in the JoobQ system. These updates enhance metrics accuracy, code maintainability, performance, and adherence to SOLID principles. Below is a concise summary of the changes:
1. Enhanced Metrics Calculations
- Accuracy Improvements:
- Separated Rate Calculations: Introduced
per_second_rate
andpercentage_rate
methods. - Correct Time Initialization: Initialized
total_job_wait_time
andtotal_job_execution_time
to zero. - Consistent Elapsed Time: Added
elapsed_time
method for accurate time tracking.
- Separated Rate Calculations: Introduced
- Benefits: Metrics now accurately reflect queue performance, ensuring reliable monitoring and decision-making.
2. Removed Redundant Metric
- Eliminated Metric:
jobs_per_worker_per_second
. - Reason: It was redundant and could be derived from existing metrics.
- Benefits: Simplified codebase and reduced computational overhead.
3. Simplified Total Jobs Enqueued Calculation
- Change: Removed the
total_jobs_enqueued
property. - Approach: Calculated dynamically using existing metrics:
[
\text{total_jobs_enqueued} = \text{size} + \text{completed.get} + \text{dead.get} + \text{busy.get}
] - Benefits: Ensured consistency in job counts and simplified state management.
4. Introduced Average Jobs In-Flight Metric
- New Metric:
average_jobs_in_flight
. - Purpose: Measures the average number of jobs being processed concurrently.
- Calculation:
[
\text{Average Jobs In-Flight} = \frac{\text{Total Job Execution Time}}{\text{Elapsed Time}}
] - Benefits: Provides insights into worker utilization and helps optimize processing.
5. Refactored Code Following SOLID Principles
- Single Responsibility Principle:
- Separated concerns into
Queue(T)
,Metrics
, andWorkerManager
classes.
- Separated concerns into
- Dependency Inversion Principle:
- Introduced interfaces (
IStore
,IWorker
) to depend on abstractions.
- Introduced interfaces (
- Other Principles:
- Adhered to Open/Closed, Liskov Substitution, and Interface Segregation principles.
- Benefits: Improved maintainability, extensibility, and testability.
6. Improved Worker(T)
Class Structure
- Focus on Job Execution:
Worker
class now solely handles job execution.
- New Components:
Throttler
Class: Manages rate limiting.FailHandler
Class: Handles job failures and retries.
- Benefits: Enhanced code clarity, metrics accuracy, and error handling.
7. Corrected Queue Reduction Rate Calculation
- Fix: Removed
.abs
fromqueue_reduction_rate
to preserve the sign. - Result: Accurately indicates whether the queue size is increasing or decreasing.
- Benefits: Provides true insights into queue behavior for better operational decisions.
8. Addressed Low Worker Utilization
- Issue: Worker utilization was low (e.g., 0.14%).
- Actions:
- Diagnosed potential causes like insufficient job load or excessive workers.
- Recommended increasing job volume, adjusting worker count, and optimizing configurations.
- Benefits: Improved resource efficiency and system performance.
General Enhancements
- Thread Safety: Ensured with atomic operations and proper synchronization.
- Logging and Monitoring: Enhanced for better visibility and debugging.
- Exception Handling: Strengthened across components for robustness.
- Documentation: Updated to reflect changes and improve clarity.
We encourage all users to update to the latest version to benefit from these improvements. Your feedback is valuable and helps us continue enhancing the JoobQ system.
v0.4.0
Release Notes for JoobQ
For a complete list of changes, please refer to the commit history.
Full Changelog: v0.3.1...v0.4.0
Version 0.4.0
New Features
- Queue Throttling: Introduced the ability to throttle queues to control the rate of job processing.
- Dead Letter Queue: Added support for a dead letter queue to handle jobs that fail after exhausting retries.
- Job Expiration: Implemented job expiration to ensure that only valid jobs are processed.
- REST API Enhancements: Expanded the REST API to include endpoints for job registry and queue metrics.
- Scheduler Enhancements: Improved the scheduler to support recurring jobs and cron-based scheduling.
Improvements
- Logging: Enhanced logging capabilities for better traceability and debugging.
- Retry Logic: Improved retry logic with exponential backoff to avoid overwhelming the system.
- Worker Management: Added support for graceful worker shutdown and controlled job execution.
- Configuration: Simplified queue configuration with the
JoobQ.configure
method.
Bug Fixes
- Fixed issues with job enqueuing and dequeuing in the Redis store.
- Resolved race conditions in worker job processing.
- Addressed bugs related to job status updates and metrics tracking.
Documentation
- Updated README with new features and usage examples.
- Added detailed documentation for the new REST API endpoints.
- Improved inline code comments for better code understanding.
Miscellaneous
- Updated dependencies to the latest versions.
- Refactored code for better readability and maintainability.
v0.3.1
v0.3.0: [Breaking Change] Remove method overload
Changes - `SomeJob.perform(within)` is now `SomeJob.delay(for)` - `SomeJob.run(every)` is now `SomeJob.schedule(every)`