added export doc-comments
test-org/integration-module/pipeline/pr-rc This commit looks good Details

feature/1126
prplV 2025-03-05 13:17:08 +03:00
parent 9499c97ce6
commit ba82d59c74
1 changed files with 26 additions and 0 deletions

View File

@ -6,6 +6,32 @@ use std::env;
use anyhow::Result; use anyhow::Result;
use log::{info, error}; 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 { pub struct Exporter {
pool : Option<Pool>, pool : Option<Pool>,
} }