A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/kontera-technologies/nutcracker below:

kontera-technologies/nutcracker: Gem wrapper for Twitter's Twemproxy ( AKA Nutcracker )

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

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.

Add this line to your application's Gemfile:

And then execute:

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)

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

you can also attach to a running instance of nutcracker

Nutcracker.attach(config_file: 'cluster.yaml', stats_port: 22222)

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

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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4