A simple Rust library that allows pinging healthchecks.io to indicate success or failure of a task.
```rust use healthchecks::ping::get_client;
fn main() { let config = getclient("073305d2-3582-4dd6-b6a3-425e88583ca2").unwrap(); config.reportfailure(); config.report_success(); } ```
If you want to set a custom user agent for filtering purposes (default is healthcheck-rs/$library_version
)
```rust use healthchecks::ping::get_client;
fn main() { let config = getclient("073305d2-3582-4dd6-b6a3-425e88583ca2").unwrap().setuseragent("very-fancy-useragent"); config.reportfailure(); config.report_success(); }
```
You can also start a timer to record durations on healthchecks.io.
```rust use healthchecks::ping::get_client;
fn dolongrunning_task() {}
fn main() { let config = getclient("073305d2-3582-4dd6-b6a3-425e88583ca2").unwrap(); config.starttimer(); dolongrunningtask(); config.reportsuccess(); }
```
Dual licensed under Apache 2.0 or MIT at your option.