Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.

Commit a1f7903

Browse files
committed
Update status server to include mgs fs
The stats service should now retrieve the mgs filesystems from the lustre collector library. Signed-off-by: johnsonw <[email protected]>
1 parent 7db73df commit a1f7903

14 files changed

+425
-38
lines changed

Cargo.lock

+5-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

iml-agent/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ inotify = "0.8"
3131
lazy_static = "1.4.0"
3232
libc = "0.2"
3333
liblustreapi = {path = "../liblustreapi", version = "0.3"}
34-
lustre_collector = "=0.2.13"
34+
lustre_collector = "0.2.15"
3535
prettytable-rs = "0.8"
3636
reqwest = {version = "0.10", default-features = false, features = ["rustls-tls", "json", "stream"]}
3737
serde = {version = "1", features = ["derive"]}

iml-agent/src/daemon_plugins/stats.rs

+15-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ use crate::{
99
use futures::{future, Future, FutureExt, StreamExt, TryFutureExt, TryStreamExt};
1010
use iml_cmd::Command;
1111
use lustre_collector::{
12-
parse_cpustats_output, parse_lctl_output, parse_lnetctl_output, parse_meminfo_output, parser,
12+
mgs::mgs_fs_parser, parse_cpustats_output, parse_lctl_output, parse_lnetctl_output,
13+
parse_meminfo_output, parse_mgs_fs_output, parser,
1314
};
1415
use std::{io, pin::Pin, str};
1516

@@ -40,6 +41,14 @@ impl DaemonPlugin for Stats {
4041
let mut cmd1 = Command::new("lctl");
4142
let cmd1 = cmd1.arg("get_param").args(params()).output().err_into();
4243

44+
let mut cmd1a = Command::new("lctl");
45+
let cmd1a = cmd1a
46+
.arg("get_param")
47+
.arg("-N")
48+
.args(mgs_fs_parser::params())
49+
.output()
50+
.err_into();
51+
4352
let mut cmd2 = Command::new("lnetctl");
4453
let cmd2 = cmd2.arg("export").output().err_into();
4554

@@ -48,11 +57,14 @@ impl DaemonPlugin for Stats {
4857
let mut cmd4 = iml_fs::stream_file_lines("/proc/stat").boxed();
4958
let cmd4 = cmd4.try_next().err_into();
5059

51-
let result = future::try_join4(cmd1, cmd2, cmd3, cmd4).await;
60+
let result = future::try_join5(cmd1, cmd1a, cmd2, cmd3, cmd4).await;
5261

5362
match result {
54-
Ok((lctl, lnetctl, meminfo, maybe_cpustats)) => {
63+
Ok((lctl, mgs_fs, lnetctl, meminfo, maybe_cpustats)) => {
5564
let mut lctl_output = parse_lctl_output(&lctl.stdout)?;
65+
let mut mgs_fs_output = parse_mgs_fs_output(&mgs_fs.stdout).unwrap_or_default();
66+
67+
lctl_output.append(&mut mgs_fs_output);
5668

5769
let lnetctl_stats = str::from_utf8(&lnetctl.stdout)?;
5870

iml-services/iml-device/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ iml-rabbit = {path = "../../iml-rabbit", version = "0.3"}
1515
iml-service-queue = {path = "../iml-service-queue", version = "0.3"}
1616
iml-tracing = {version = "0.2", path = "../../iml-tracing"}
1717
iml-wire-types = {path = "../../iml-wire-types", version = "0.3", features = ["postgres-interop"]}
18+
influx_db_client = {version = "0.4", default-features = false, features = ["rustls-tls"]}
1819
serde = {version = "1", features = ["derive"]}
1920
serde_json = "1.0"
2021
thiserror = "1.0"
2122
tokio = {version = "0.2", features = ["macros", "rt-threaded"]}
23+
url = "2.1.1"
2224
warp = "0.2"
2325

2426
[dev-dependencies]

iml-services/iml-device/src/error.rs

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use iml_postgres::sqlx;
66
use iml_service_queue::service_queue::ImlServiceQueueError;
7+
use influx_db_client;
78
use thiserror::Error;
89
use warp::reject;
910

@@ -19,6 +20,8 @@ pub enum ImlDeviceError {
1920
SqlxCoreError(#[from] sqlx::Error),
2021
#[error(transparent)]
2122
SqlxMigrateError(#[from] sqlx::migrate::MigrateError),
23+
#[error(transparent)]
24+
InfluxDbError(#[from] influx_db_client::error::Error),
2225
}
2326

2427
impl reject::Reject for ImlDeviceError {}

0 commit comments

Comments
 (0)