Fnord::Client
Send events to an FnordMetric server via UDP (or TCP).
Installation
Add this line to your application's Gemfile:
gem 'fnord-client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fnord-client
Usage
# Connect to FnordMetric inbound stream over UDP (default)
$fnord = Fnord::Client('localhost', 1337)
# Connect to FnordMetric inbound stream over TCP
$fnord = Fnord::Client('localhost', 1337, :protocol => :tcp)
# send JSON-encoded event
$fnord.event("message_received", { :user_id => 123 })
# "{\"_type\":\"message_received\",\"user_id\":\"123\"}"
# configure FnordMetric namespace
Fnord::Client.namespace = "staging"
$fnord.event("message_received")
# "{\"_type\":\"message_received\",\"_namespace\":\"staging\"}"
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request