Skip to content

Commit

Permalink
Improve README
Browse files Browse the repository at this point in the history
  • Loading branch information
rarruda committed Jan 9, 2019
1 parent 2676d5a commit 4691d8e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
30 changes: 24 additions & 6 deletions README.md
Expand Up @@ -25,16 +25,15 @@ Or install it yourself as:

## Configure

It is **required** to configure the `url` of the unleash server. Please substitute the sample `'http://unleash.herokuapp.com/api'` for the url of your own instance.
It is **required** to configure the `url` of the unleash server and `app_name` with the name of the runninng application. Please substitute the sample `'http://unleash.herokuapp.com/api'` for the url of your own instance.

It is **highly recommended** to configure `app_name` and the `instance_id`.
It is **highly recommended** to configure the `instance_id` parameter as well.

For other options please see `lib/unleash/configuration.rb`.

```ruby
Unleash.configure do |config|
config.url = 'http://unleash.herokuapp.com/api'
config.app_name = 'my_ruby_app'
config.url = 'http://unleash.herokuapp.com/api'
config.app_name = 'my_ruby_app'
end
```

Expand All @@ -44,6 +43,25 @@ or instantiate the client with the valid configuration:
UNLEASH = Unleash::Client.new(url: 'http://unleash.herokuapp.com/api', app_name: 'my_ruby_app')
```

#### List of Arguments

Argument | Description | Required? | Type | Default Value|
---------|-------------|-----------|-------|---------------|
`url` | Unleash server URL. | Y | String | N/A |
`app_name` | Name of your program. | Y | String | N/A |
`instance_id` | Identifier for the running instance of program. Important so you can trace back to where metrics are being collected from. **Highly recommended be be set.** | N | String | random UUID |
`refresh_interval` | How often the unleash client should check with the server for configuration changes. | N | Integer | 15 |
`metrics_interval` | How often the unleash client should send metrics to server. | N | Integer | 10 |
`disable_metrics` | Disables sending metrics to Unleash server. | N | Boolean | `false` |
`custom_http_headers` | Custom headers to send to Unleash. | N | Hash | {} |
`timeout` | How long to wait for the connection to be established or wait in reading state (open_timeout/read_timeout) | N | Integer | 30 |
`retry_limit` | How many consecutive failures in connecting to the Unleash server are allowed before giving up. | N | Integer | 1 |
`backup_file` | Filename to store the last known state from the Unleash server. Best to not change this from the default. | N | String | `Dir.tmpdir + "/unleash-#{app_name}-repo.json` |
`logger` | Specify a custom `Logger` class to handle logs from the client. | N | Class | `Logger.new(STDOUT)` |
`log_level` | Change the log level for the `Logger` class. Constant from `Logger::Severity`. | N | Constant | `Logger::ERROR` |

For in a more in depth look, please see `lib/unleash/configuration.rb`.

## Usage in a plain Ruby Application

```ruby
Expand Down Expand Up @@ -155,7 +173,7 @@ This client comes with the all the required strategies out of the box:
* GradualRolloutSessionIdStrategy
* GradualRolloutUserIdStrategy
* RemoteAddressStrategy
* UnknowndStrategy
* UnknownStrategy
* UserWithIdStrategy


Expand Down
10 changes: 5 additions & 5 deletions TODO.md
Expand Up @@ -6,13 +6,10 @@ The Ruby client should be pretty stable now. But no warranty is given, and some

Implement:
----------
* Possibility for custom HTTP headers when interacting with unleash server.
* Document writing of custom strategies.

To test: (and write tests for)
--------
* Implement spec test for ruby client specs using https://github.com/Unleash/client-specification/blob/master/05-gradual-rollout-random-strategy.json (similar to the examples below) to ensure consistent client behaviour.
* java: https://github.com/Unleash/unleash-client-java/compare/master...integration-spec
* node: https://github.com/Unleash/unleash-client-node/compare/client-specification?expand=1
* MetricsReporter
* everything else :)

Expand All @@ -34,4 +31,7 @@ DONE:
* Switch hashing function to use murmurhash3 as per https://github.com/Unleash/unleash/issues/247
* Document usage with Rails
* Support for allowing custom strategies.

* Possibility for custom HTTP headers when interacting with unleash server.
* Implement spec test for ruby client specs using https://github.com/Unleash/client-specification/blob/master/05-gradual-rollout-random-strategy.json (similar to the examples below) to ensure consistent client behaviour.
* java: https://github.com/Unleash/unleash-client-java/compare/master...integration-spec
* node: https://github.com/Unleash/unleash-client-node/compare/client-specification?expand=1

0 comments on commit 4691d8e

Please sign in to comment.