metrics unittests
parent
c55ebec16c
commit
3c04acdc9f
|
|
@ -1,6 +1,8 @@
|
||||||
pub mod files;
|
pub mod files;
|
||||||
pub mod prcs;
|
pub mod prcs;
|
||||||
pub mod services;
|
pub mod services;
|
||||||
|
pub mod hagent;
|
||||||
|
pub mod metrics;
|
||||||
|
|
||||||
use crate::options::structs::TrackingProcess;
|
use crate::options::structs::TrackingProcess;
|
||||||
use files::create_watcher;
|
use files::create_watcher;
|
||||||
|
|
@ -210,7 +212,7 @@ pub fn get_container_id() -> Option<String> {
|
||||||
}
|
}
|
||||||
Some(String::from_utf8_lossy(&output.stdout).to_string())
|
Some(String::from_utf8_lossy(&output.stdout).to_string())
|
||||||
}
|
}
|
||||||
Err(er) => {
|
Err(_) => {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
// module needed to get metrics such as
|
||||||
|
// cpu load, memmory load and net activity
|
||||||
|
|
||||||
|
//
|
||||||
|
// code will be here
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod metrics_unittets {
|
||||||
|
#[tokio::test]
|
||||||
|
// Option<String> output
|
||||||
|
// echo func
|
||||||
|
async fn get_cpu_load() {
|
||||||
|
assert!(true);
|
||||||
|
}
|
||||||
|
#[tokio::test]
|
||||||
|
// Option<String> output
|
||||||
|
// echo func
|
||||||
|
async fn get_ram_load() {
|
||||||
|
assert!(true);
|
||||||
|
}
|
||||||
|
#[tokio::test]
|
||||||
|
// Option<String> output
|
||||||
|
// echo func
|
||||||
|
async fn get_mem_load() {
|
||||||
|
assert!(true);
|
||||||
|
}
|
||||||
|
#[tokio::test]
|
||||||
|
// can't be tested this way because of 0-0 loop of checking buffer
|
||||||
|
// async func with loop inside
|
||||||
|
async fn get_net_stat(){
|
||||||
|
assert!(true);
|
||||||
|
}
|
||||||
|
#[tokio::test]
|
||||||
|
async fn init_sumodules() {
|
||||||
|
assert!(true);
|
||||||
|
}
|
||||||
|
// Option<Vec<TrackingProcess OR String>> output
|
||||||
|
// echo func
|
||||||
|
#[tokio::test]
|
||||||
|
async fn get_info_about_subsystems() {
|
||||||
|
assert!(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue