use std::fmt;
use std::path::Path;
use async_trait::async_trait;
use crate::metadata::ReportMetadata;
pub mod local;
pub mod multi;
#[cfg(feature = "s3-no-defaults")]
pub mod s3;
#[async_trait]
pub trait Reporter: fmt::Debug {
async fn report(
&self,
jfr: Vec<u8>,
metadata: &ReportMetadata,
) -> Result<(), Box<dyn std::error::Error + Send>>;
#[doc(hidden)]
fn report_blocking(
&self,
_jfr_path: &Path,
_metadata: &ReportMetadata,
) -> Result<(), Box<dyn std::error::Error + Send>> {
tracing::info!(
"reporter does not support synchronous reporting, last sample will be lost. \
Call `RunningProfiler::stop().await` before shutdown to ensure all samples are uploaded."
);
Ok(())
}
}