diff --git a/crates/api-grub/src/export.rs b/crates/api-grub/src/export.rs index a984f7f..9e8e429 100644 --- a/crates/api-grub/src/export.rs +++ b/crates/api-grub/src/export.rs @@ -6,6 +6,32 @@ use std::env; use anyhow::Result; use log::{info, error}; +/// An entity which handles DB connections. +/// +/// This struct is used to be a layer between API-grab workers +/// and the `pool` of DB connections to save grabbing processes statuses +/// (now `PostgreSQL`, slowly migrating to `ClickHouse` support) +/// +/// # Examples +/// +/// ``` +/// use api-grub::export::Expoter; +/// +/// let exporter = Expoter::init(); +/// +/// assert!(exporter.get_connection_from_pool().is_some()); +/// ``` +/// +/// # Hint: +/// +/// - use `export_data` method to export metrics to DB +/// +/// - use `export_metrics` method to export metrics (`PrometehusMetrics` +/// type) to the Prometehus exporter (`$EXPORTER_URL`) +/// +/// - use `export_metrics_extended` method to export metrics ( +/// `*PrometehusMetricsExtended*` type with `desc` field) to the +/// Prometehus exporter (`$EXPORTER_URL`) pub struct Exporter { pool : Option, }