use limiteron::telemetry::{Metrics, TelemetryConfig};
use std::time::Duration;
#[tokio::test]
async fn test_telemetry_config_default() {
let config = TelemetryConfig::default();
assert!(!config.service_name.is_empty());
}
#[tokio::test]
async fn test_telemetry_config_builder() {
let config = TelemetryConfig::new("my-service");
assert_eq!(config.service_name, "my-service");
}
#[tokio::test]
async fn test_metrics_new() {
let metrics = Metrics::new();
metrics.record_check(Duration::from_millis(1), true);
metrics.record_check(Duration::from_millis(5), false);
metrics.record_error("test_error");
metrics.record_ban();
}
#[tokio::test]
async fn test_metrics_gather() {
let metrics = Metrics::new();
let output = metrics.gather();
assert!(output.is_empty() || !output.is_empty()); }