Git Product home page Git Product logo

nutcracker's Introduction

Nutcracker

This library wraps Twitter's Nutcracker in a gem package and provides a simple ruby API to the nutcracker executable.

Disclaimer

this project is still in its early stages so things could be a little bit buggy, if you find one feel free to report it.

Motivation

The main motivation here is to take the advantages of working with Bundler's dependencies management and to be able to embed Twitter's Nutcracker as a dependency to any Ruby project, this allow you to create small-configuration-only-apps tied to specific version of Nutcracker as I show in the example bellow.

Plugins

Installation

Add this line to your application's Gemfile:

gem 'nutcracker'

And then execute:

$ bundle install

after the gem was successfully installed, the nutcracker executable should be available

[root@somewhere ~]# nutcracker --help
This is nutcracker-0.2.3

Usage: nutcracker [-?hVdDt] [-v verbosity level] [-o output file]
                  [-c conf file] [-s stats port] [-a stats addr]
                  [-i stats interval] [-p pid file] [-m mbuf size]

Options:
  -h, --help             : this help
  -V, --version          : show version and exit
  -t, --test-conf        : test configuration for syntax errors and exit
  -d, --daemonize        : run as a daemon
  -D, --describe-stats   : print stats description and exit
  -v, --verbosity=N      : set logging level (default: 5, min: 0, max: 11)
  -o, --output=S         : set logging file (default: stderr)
  -c, --conf-file=S      : set configuration file (default: conf/nutcracker.yml)
  -s, --stats-port=N     : set stats monitoring port (default: 22222)
  -a, --stats-addr=S     : set stats monitoring ip (default: 0.0.0.0)
  -i, --stats-interval=N : set stats aggregation interval in msec (default: 30000 msec)
  -p, --pid-file=S       : set pid file (default: off)
  -m, --mbuf-size=N      : set size of mbuf chunk in bytes (default: 16384 bytes)

Ruby Wrapper

a simple ruby wrapper is also included

require 'nutcracker'

nutcracker = Nutcracker.start(config_file: 'cluster.yaml')
nutcracker.running? # => true

nutcracker.stats # => {"source"=>"local", "version"=>"0.2.4", "uptime"=>6...}

nutcracker.stop 
nutcracker.running? # => false

nutcracker.start
nutcracker.join # wait for server to exit

Building new gems

  • Set the version @ lib/nutcracker/version.rb ( Available Versions )
  • run the rake build command
  • look for nutcracker-X.Y.Z gem under the pkg folder

Warranty

This software is provided β€œas is” and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose.

for more details like licensing etc, please look @ Nutcracker

nutcracker's People

Watchers

James Cloos avatar Jeff avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.