Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ajitsing/sidekiq_queue_metrics
Records stats of each sidekiq queue and exposes APIs to retrieve them
https://github.com/ajitsing/sidekiq_queue_metrics
ruby rubygem sidekiq sidekiq-metrics sidekiq-monitor sidekiq-queue-stats
Last synced: about 2 months ago
JSON representation
Records stats of each sidekiq queue and exposes APIs to retrieve them
- Host: GitHub
- URL: https://github.com/ajitsing/sidekiq_queue_metrics
- Owner: ajitsing
- License: mit
- Created: 2018-07-22T14:09:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-15T11:33:52.000Z (about 2 years ago)
- Last Synced: 2024-10-25T13:52:46.102Z (2 months ago)
- Topics: ruby, rubygem, sidekiq, sidekiq-metrics, sidekiq-monitor, sidekiq-queue-stats
- Language: Ruby
- Homepage: http://www.singhajit.com/monitoring-individual-queue-in-sidekiq/
- Size: 55.7 KB
- Stars: 32
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sidekiq_queue_metrics
Records stats of each sidekiq queue and exposes APIs to retrieve them[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/ajitsing/sidekiq_queue_metrics/graphs/commit-activity)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://opensource.org/licenses/MIT)
[![Gem Version](https://badge.fury.io/rb/sidekiq_queue_metrics.svg)](https://badge.fury.io/rb/sidekiq_queue_metrics)
[![HitCount](http://hits.dwyl.io/ajitsing/sidekiq_queue_metrics.svg)](http://hits.dwyl.io/ajitsing/sidekiq_queue_metrics)
![Gem Downloads](http://ruby-gem-downloads-badge.herokuapp.com/sidekiq_queue_metrics?type=total)
[![Build Status](https://travis-ci.org/ajitsing/sidekiq_queue_metrics.svg?branch=master)](https://travis-ci.org/ajitsing/sidekiq_queue_metrics)
[![Twitter Follow](https://img.shields.io/twitter/follow/Ajit5ingh.svg?style=social)](https://twitter.com/Ajit5ingh)## Installation
Add this line to your application's Gemfile:
```ruby
gem 'sidekiq_queue_metrics'
```## Configuration
```ruby
require 'sidekiq_queue_metrics'Sidekiq.configure_server do |config|
Sidekiq::QueueMetrics.init(config)
end
```## Usage
`sidekiq_queue_metrics` adds a new tab `Queue Metrics` in Sidekiq UI. In `Queue Metrics` tab you will see widget of all the queues with latest stats. To checkout individual queue summary click on the queue name. On queue summary page you will see all the stats of the queue along with 50 recently failed jobs. To see the details of the failed job click on the enqueued time column of the failed job row.The failed job count is configuratble. You can configure your desired count using below config.
```ruby
Sidekiq::QueueMetrics.max_recently_failed_jobs = 100
```### Queue Summary
### Failed Job
You can also use the below apis to directly consume the queue metrics.
Fetch stats of all queues:
```ruby
Sidekiq::QueueMetrics.fetch
```Output:
```ruby
{
"mailer_queue" => {"processed" => 5, "failed" => 1, "enqueued" => 2, "in_retry" => 0, "scheduled" => 0},
"default_queue" => {"processed" => 10, "failed" => 0, "enqueued" => 1, "in_retry" => 1, "scheduled" => 2}
}
```## Contributing
1. Fork it ( https://github.com/ajitsing/sidekiq_queue_metrics/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## License
```LICENSE
MIT LicenseCopyright (c) 2018 Ajit Singh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```