Project

schlep

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby client for schlep. Schlep provides a simple interface for logging and broadcasting events.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0
 Project Readme

schlep Build Status Dependency Status

Requirements

Schlep needs a Redis server, a Schlep server, and some events. It's tested on most versions of Ruby.

Installation

gem install schlep

or, add it to your Gemfile:

gem 'schlep'

and then run bundle install.

Configuration

By default, Schlep will connect to Redis locally, use a blank string as the app name, and get the hostname by running hostname.

To change this, you can configure things one at a time:

Schlep.app       = "My App"
Schlep.host      = "localhost"
Schlep.redis_url = "redis://redis:password@localhost:6379"

or in a block:

Schlep.configure do |config|
  config.app       = "My App"
  config.host      = "localhost"
  config.redis_url = "redis://redis:password@localhost:6379"
end

If you're using Rails, you should probably put the block above in config/initializers/schlep.rb.

For other Ruby apps, anywhere before your first Schlep event is fine.

Usage

Basic event

Schlep.event "event_type", something

something can be almost any Ruby object, and Schlep will do it's best to serialize it to JSON.

Multiple events

For performance, Schlep can send multiple events of the same type to Redis in a more efficient manner. To use this, simply call Schlep.events instead of Schlep.event, and pass an array of objects to serialize:

events = []

1_000_000.times { |n| events << n }

Schlep.events "load_test", events

Support

If you run into any problems, please submit an issue.