README.markdown in riemann-client-1.0.0 vs README.markdown in riemann-client-1.0.1

- old
+ new

@@ -1,14 +1,18 @@ -Installing -========== +# Riemann Ruby Client - gem install riemann-client +[![CI](https://github.com/riemann/riemann-ruby-client/actions/workflows/ci.yml/badge.svg)](https://github.com/riemann/riemann-ruby-client/actions/workflows/ci.yml) -Use -=== +## Installing -``` ruby +```shell +gem install riemann-client +``` + +## Use + +```ruby require 'riemann/client' # Create a client. Host, port and timeout are optional. c = Riemann::Client.new host: 'localhost', port: 5555, timeout: 5 @@ -36,13 +40,13 @@ # Or specific states matching a query c['host =~ "%.dc1" and (state = "critical" or state = "warning")'] ``` -Transports -========== +## Transports + Riemann::Client sends small events over UDP by default, and uses TCP for queries and large events. UDP sends are essentially "shouting into the void". They will not block your application and are roughly an order of magnitude faster than TCP, but you will not know if the server is down or encountered an error. You can specify what transport to use by selecting a subclient: @@ -52,15 +56,20 @@ c.tcp << { :state => "ok" } # => #<Message ...> c.tcp["true"] # => [#<Event ... >, ...] c.udp["true"] # => raise Riemann::Client::Unsupported ``` -Client state management -======================= +## Client state management Riemann::Client provides some classes to make managing state updates easier. Riemann::MetricThread starts a thread to poll a metric periodically, which can be used to flush an accumulated value to ustate at regular intervals. Riemann::AutoState bundles a state and a client together. Any changes to the AutoState automatically send the new state to the client. + +## License + +The MIT License + +Copyright (c) 2011-2022 Kyle Kingsbury