README.md in cronitor-1.0.0 vs README.md in cronitor-1.1.0
- old
+ new
@@ -31,27 +31,41 @@
```ruby
require 'cronitor'
monitor_options = {
- name: 'My Fancy Monitor',
- notifications: {
- emails: ['test@example.com'],
- slack: [],
- pagerduty: [],
- phones: [],
- webhooks: []
- },
- rules: [
- {
- rule_type: 'not_run_in',
- duration: 5
- time_unit: 'seconds'
- }
- ],
- note: 'A human-friendly description of this monitor'
+ name: 'My Fancy Monitor',
+ notifications: {
+ emails: ['test@example.com'],
+ slack: [],
+ pagerduty: [],
+ phones: [],
+ webhooks: []
+ },
+ rules: [
+ {
+ rule_type: 'not_run_in',
+ duration: 5
+ rime_unit: 'seconds'
+ }
+ ],
+ note: 'A human-friendly description of this monitor'
}
my_monitor = Cronitor.new token: 'api_token', opts: monitor_options
+```
+
+You may optionally specify a `:human_readable` value for your rule(s), otherwise one will be crafted for you:
+
+```ruby
+monitor_options = {
+ rules: [
+ {
+ rule_type: 'not_run_in',
+ duration: 5
+ time_unit: 'seconds',
+ human_readable: 'not_run_in 5 seconds'
+ }
+ ],
```
### Pinging a Monitor
Once you’ve created a monitor, you can continue to use the existing instance of the object to ping the monitor that your task status: `run`, `complete`, or `fail`.