<commit_before>
dogstatsd-ruby
==============

A client for DogStatsd, an extension of the Statsd metric server for Datadog.

[![Build Status](https://secure.travis-ci.org/DataDog/dogstatsd-ruby.png)](http://travis-ci.org/DataDog/dogstatsd-ruby)

Quick Start Guide
-----------------

First install `dogstatsd-ruby`:

    gem install dogstatsd-ruby

Then start instrumenting your code:

    # Load the dogstats module.
    require 'statsd'

    # Create a stats instance.
    statsd = Statsd.new('localhost', 8125)

    # Increment a counter.
    statsd.increment('page.views')

    # Record a gauge.
    statsd.gauge('users.online', 123)

    # Sample a histogram
    statsd.histogram('file.upload.size', 1234)

    # Time a block of code
    statsd.time('page.render') do
      render_page('home.html')
    end

    # Tag a metric.
    statsd.histogram('query.time', 10, :tags => ["version:1"])
<commit_msg>Cleaning up docs.<commit_after>
dogstatsd-ruby
==============

A client for DogStatsd, an extension of the Statsd metric server for Datadog.

[![Build Status](https://secure.travis-ci.org/DataDog/dogstatsd-ruby.png)](http://travis-ci.org/DataDog/dogstatsd-ruby)

Quick Start Guide
-----------------

First install the library:

    gem install dogstatsd-ruby

Then start instrumenting your code:

    # Load the dogstats module.
    require 'statsd'

    # Create a stats instance.
    statsd = Statsd.new('localhost', 8125)

    # Increment a counter.
    statsd.increment('page.views')

    # Record a gauge 50% of the time.
    statsd.gauge('users.online', 123, :sample_rate=>0.5)

    # Sample a histogram
    statsd.histogram('file.upload.size', 1234)

    # Time a block of code
    statsd.time('page.render') do
      render_page('home.html')
    end

    # Tag a metric.
    statsd.histogram('query.time', 10, :tags => ["version:1"])

{'fraction_non_alphanumeric': 0.15243243243243243, 'fraction_numerical': 0.017297297297297298, 'mean_word_length': 3.0592105263157894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7400705', 'n_tokens_mistral': 653, 'n_tokens_neox': 589, 'n_words': 156}