#![warn(rust_2018_idioms, unreachable_pub, missing_docs)]
use std::sync::Arc;
use tracing::error;
use elfo_core::Schema;
use self::{recorder::Recorder, storage::Storage};
pub mod protocol;
mod actor;
mod config;
mod recorder;
mod render;
mod storage;
#[cfg(feature = "unstable")]
mod allocator;
#[cfg(feature = "unstable")]
pub use allocator::AllocatorStats;
pub fn init() -> Schema {
let storage = Arc::new(Storage::new());
let recorder = Recorder::new(storage.clone());
let schema = actor::new(storage);
if let Err(err) = metrics::set_boxed_recorder(Box::new(recorder)) {
error!(error = %err, "failed to set a metric recorder");
}
schema
}
#[deprecated] pub fn new() -> Schema {
init()
}