Prometheus edge detector

Find the most recent rising or dropping edge from a prometheus query

Usage

```rust use mainerror::MainError; use prometheusedge_detector::EdgeDetector; use tokio::time::Duration;

[tokio::main]

async fn main() -> Result<(), MainError> { let edgedetector = EdgeDetector::new("http://example.com"); let edge = edgedetector .getlastedge("prometheusvalue", 1, 0, Duration::fromsecs(60 * 60)) .await?;

if let Some(edge_time) = edge {
    print!("Last dropping edge: {}", edge_time);
} else {
    println!("Query doesn't end with dropping edge");
}

Ok(())

} ```

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.