No commit activity in last 3 years
No release in over 3 years
InfluxDB metrics for Sneakers workers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
~> 10.0
~> 3.0

Runtime

~> 0.3.0
 Project Readme

Sneakers::InfluxDB

This gem collect metrics from Sneakers workers and insert them in InfluxDB. Those metrics can be useful so you know how many works you are doing, how many started and ended, as well the time each work takes to execute.

This gem depends on influxdb gem 0.3.x. This branch supports Ruby 2.1 and less, so it shouldn't break current compatibility while using Sneakers and Bunny gems.

Installation

Add this line to your application's Gemfile:

gem 'sneakers-influxdb'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sneakers-influxdb

Usage

Where you configure the Sneakers gem, pass the object Sneakers::InfluxDBMetrics to the metrics option.

Example:

require 'sneakers-influxdb'

influxdb_metrics = Sneakers::InfluxDBMetrics.new('sneakers', host: 'localhost',
                                                                      port: 8086,
                                                                      username: 'admin',
                                                                      password: 'admin')

Sneakers.configure(workers:           8,
                   threads:           1,
                   timeout_job_after: 2,
                   log: Rails.logger,
                   metrics: influxdb_metrics)

The InfluxDBMetrics initializer receives the same params as the InfluxDB::Client class. You can also pass an instance of InfluxDB::Client if you already uses the client in other parts of your project.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/gmmoreira/sneakers-influxdb.

License

The gem is available as open source under the terms of the MIT License.