Compare commits
No commits in common. "96dc94bf0b22ca561ca7d8c16268f05b7aa30571" and "ba82d59c746dd4fa6a1defbe7a33967845d4d794" have entirely different histories.
96dc94bf0b
...
ba82d59c74
|
|
@ -5,7 +5,6 @@ use tokio_postgres::NoTls;
|
|||
use std::env;
|
||||
use anyhow::Result;
|
||||
use log::{info, error};
|
||||
use std::ops::Drop;
|
||||
|
||||
/// An entity which handles DB connections.
|
||||
///
|
||||
|
|
@ -103,9 +102,3 @@ impl Exporter {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
impl Drop for Exporter {
|
||||
fn drop(&mut self) {
|
||||
info!("Deinitializng Exporter and DB connection pool ...")
|
||||
}
|
||||
}
|
||||
|
|
@ -2,21 +2,6 @@
|
|||
use serde_json::{json, Value};
|
||||
use integr_structs::api::v3::{Metric, MetricOutput};
|
||||
|
||||
/// A JSON-parser struct
|
||||
///
|
||||
/// Using in metric extracting from Server Response
|
||||
/// with metrics mechanism
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
/// use api-grub::json::JsonParser;
|
||||
/// use use integr_structs::api::v3::Metric;
|
||||
///
|
||||
/// let json = b""flat1" : { "room1" : { "rt_tempo" : "+16" }}".to_vec();
|
||||
///
|
||||
/// assert!(!JsonParser::parse(vec![Metric::template()], json).is_empty());
|
||||
/// ```
|
||||
pub struct JsonParser;
|
||||
|
||||
impl JsonParser {
|
||||
|
|
|
|||
|
|
@ -160,16 +160,6 @@ pub mod v3 {
|
|||
pub json_type : String,
|
||||
pub addr : String,
|
||||
}
|
||||
impl Metric {
|
||||
pub fn template() -> Self {
|
||||
Self {
|
||||
id : "room_tempo".to_string(),
|
||||
json_type : "String".to_string(),
|
||||
addr : "flat1.room1.rt_tempo".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||
pub struct Metrics {
|
||||
pub name : String,
|
||||
|
|
|
|||
Loading…
Reference in New Issue