parent
51d16aaa73
commit
8663857896
|
|
@ -4,18 +4,14 @@ use serde_json::{Map, Value};
|
||||||
use reqwest::Client;
|
use reqwest::Client;
|
||||||
use tokio::sync::Semaphore;
|
use tokio::sync::Semaphore;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
// use crate::structs::{AuthResponse, ForTokenCredentials, GenericUrl};
|
|
||||||
use integr_structs::api::enode_monitoring::{AuthResponse, ForTokenCredentials, GenericUrl, LazyUnzip, get_chunk_size};
|
use integr_structs::api::enode_monitoring::{AuthResponse, ForTokenCredentials, GenericUrl, LazyUnzip, get_chunk_size};
|
||||||
// use crate::structs::cmdb::Query;
|
|
||||||
use integr_structs::api::enode_monitoring::cmdb::Query;
|
use integr_structs::api::enode_monitoring::cmdb::Query;
|
||||||
use tokio::task::JoinHandle;
|
use tokio::task::JoinHandle;
|
||||||
// use crate::structs::get_chunk_size;
|
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
use integr_structs::api::v3::{MetricOutputExtended, PrometheusMetricsExtended};
|
use integr_structs::api::v3::{MetricOutputExtended, PrometheusMetricsExtended};
|
||||||
use log::{error, info, warn};
|
use log::{error, info, warn};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
// use chrono::{Local, DateTime};
|
|
||||||
|
|
||||||
pub async fn get_metrics_from_monitoring(duration: usize, delay: usize) -> anyhow::Result<()> {
|
pub async fn get_metrics_from_monitoring(duration: usize, delay: usize) -> anyhow::Result<()> {
|
||||||
let timer = tokio::time::Instant::now();
|
let timer = tokio::time::Instant::now();
|
||||||
|
|
@ -70,7 +66,7 @@ impl MonitoringImporter {
|
||||||
let client = Client::new();
|
let client = Client::new();
|
||||||
let url = format!("http://{}/e-data-front/auth/login", self.ip);
|
let url = format!("http://{}/e-data-front/auth/login", self.ip);
|
||||||
let fortoken = ForTokenCredentials::new(&self.login, &self.password);
|
let fortoken = ForTokenCredentials::new(&self.login, &self.password);
|
||||||
|
|
||||||
let client = client
|
let client = client
|
||||||
.post(url)
|
.post(url)
|
||||||
.header("Content-Type", "application/json")
|
.header("Content-Type", "application/json")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue