README.md in toxiproxy-0.1.0 vs README.md in toxiproxy-0.1.1
- old
+ new
@@ -2,11 +2,11 @@
[Toxiproxy](https://github.com/shopify/toxiproxy) is a proxy to simulate network
and system conditions. The Ruby API aims to make it simple to write tests that
ensure your application behaves appropriately under harsh conditions. Before you
can use the Ruby library, you need to read the [Usage section of the Toxiproxy
-README](https://githubcom/shopify/toxiproxy#Usage).
+README](https://github.com/shopify/toxiproxy#usage).
```
gem install toxiproxy
```
@@ -59,16 +59,30 @@
```ruby
Toxiproxy[/redis/].upstream(:slow_close, delay: 100).downstream(:latency, jitter: 300).apply do
# all redises are now slow at responding and closing
end
+```
+See the [Toxiproxy README](https://github.com/shopify/toxiproxy#Toxics) for a
+list of toxics.
+
## Populate
-To populate Toxiproxy with the proxies from `config/toxiproxy.json`:
+To populate Toxiproxy pass the proxy configurations to `Toxiproxy#populate`:
```ruby
-Toxiproxy.populate("./config/toxiproxy.json")
+Toxiproxy.populate([{
+ name: "mysql_master",
+ listen: "localhost:21212",
+ upstream: "localhost:3306",
+},{
+ name: "mysql_read_only",
+ listen: "localhost:21213",
+ upstream: "localhost:3306",
+})
```
+This will create the proxies passed, if they don't already exist, in Toxiproxy.
It's recommended to do this early as early in boot as possible, see the
-[Toxiproxy README](https://github.com/shopify/toxiproxy#Usage)..
+[Toxiproxy README](https://github.com/shopify/toxiproxy#Usage). If you have many
+proxies, we recommend storing the Toxiproxy configs in a configuration file.