added export doc-comments
test-org/integration-module/pipeline/pr-rc This commit looks good
Details
test-org/integration-module/pipeline/pr-rc This commit looks good
Details
parent
9499c97ce6
commit
ba82d59c74
|
|
@ -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>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue