Compare commits
3 Commits
c55ebec16c
...
701de28cf8
| Author | SHA1 | Date |
|---|---|---|
|
|
701de28cf8 | |
|
|
cdcef60c18 | |
|
|
3c04acdc9f |
|
|
@ -1,6 +1,8 @@
|
|||
pub mod files;
|
||||
pub mod prcs;
|
||||
pub mod services;
|
||||
pub mod hagent;
|
||||
pub mod metrics;
|
||||
|
||||
use crate::options::structs::TrackingProcess;
|
||||
use files::create_watcher;
|
||||
|
|
@ -210,7 +212,7 @@ pub fn get_container_id() -> Option<String> {
|
|||
}
|
||||
Some(String::from_utf8_lossy(&output.stdout).to_string())
|
||||
}
|
||||
Err(er) => {
|
||||
Err(_) => {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
// module needed to check host-agent health condition and to communicate with it
|
||||
|
||||
//
|
||||
// code will be here
|
||||
//
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
mod hagent_unittets {
|
||||
#[tokio::test]
|
||||
// maybe bool : true -> alive, false -> dead
|
||||
// simple request on api
|
||||
async fn hagent_healthcheck() {
|
||||
assert!(true);
|
||||
}
|
||||
#[tokio::test]
|
||||
// Result<maybe Response>
|
||||
// one-shot func
|
||||
async fn send_metrics_to_hagent() {
|
||||
assert!(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
use runner_rs::*;
|
||||
// use runner_rs::*;
|
||||
|
||||
#[test]
|
||||
fn test() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue