diff --git a/README.md b/README.md index e870170d..8b439c8d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Syspect +# Sysinspect The name consists of three words: diff --git a/docs/conf.py b/docs/conf.py index 433676cc..fcc36f6a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,4 +1,4 @@ -project = "Syspect" +project = "Sysinspect" copyright = "2024, Bo Maryniuk" author = "Bo Maryniuk" version = "0.1" diff --git a/docs/index.rst b/docs/index.rst index 133b4fce..deb987a4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,8 +1,8 @@ -Welcome to the Project Syspect! -==================================== +Welcome to the Project Sysinspect! +================================== .. note:: - This documentation covers **Syspect** — the solution to + This documentation covers **Sysinspect** — the solution to examine any system, based on its architecture Model Description. .. toctree:: @@ -10,7 +10,7 @@ Welcome to the Project Syspect! modeldescr/overview -Welcome to Syspect: an engine of Anomaly Detection and Root Cause Analysis. +Welcome to Sysinspect: an engine of Anomaly Detection and Root Cause Analysis. The name consists of two words "system" and "inspection", resulting in "suspicion". This engine is indented to perform anomaly detection and root cause analysis on @@ -20,12 +20,12 @@ modules with telemetry data in order to perform various testing scenarios. Licence ------- -**Syspect** is distributed under Apache 2.0 Licence. +**Sysinspect** is distributed under Apache 2.0 Licence. Limitations ----------- -Currently **Syspect** is an experimental concept. +Currently **Sysinspect** is an experimental concept. Contributing ------------ diff --git a/docs/modeldescr/states.rst b/docs/modeldescr/states.rst index e93dd068..d944831f 100644 --- a/docs/modeldescr/states.rst +++ b/docs/modeldescr/states.rst @@ -49,7 +49,7 @@ of the specific area. Usage ----- -:bi:`Syspect` can accept several states, excluding all others. If no keyword ``--states`` +:bi:`Sysinspect` can accept several states, excluding all others. If no keyword ``--states`` is passed, then default state is selected: .. code-block:: text diff --git a/examples/models/router/README.md b/examples/models/router/README.md index c40d11d3..1cdfc46d 100644 --- a/examples/models/router/README.md +++ b/examples/models/router/README.md @@ -20,7 +20,7 @@ checkbook: The flow works the following way: -1. Checkbook provides only "entrance" spots where Syspect needs +1. Checkbook provides only "entrance" spots where Sysinspect needs to start investigations. 2. An entity, if is a collection of other entities (a group) will diff --git a/libsysinspect/src/lib.rs b/libsysinspect/src/lib.rs index a751fd72..eaef74c5 100644 --- a/libsysinspect/src/lib.rs +++ b/libsysinspect/src/lib.rs @@ -11,7 +11,7 @@ pub mod runtime; pub mod tpl; #[derive(Debug)] -pub enum SyspectError { +pub enum SysinspectError { // Specific errors ModelMultipleIndex(String), ModelDSLError(String), @@ -21,24 +21,24 @@ pub enum SyspectError { SerdeYaml(serde_yaml::Error), } -impl Error for SyspectError { +impl Error for SysinspectError { fn source(&self) -> Option<&(dyn Error + 'static)> { match self { - SyspectError::IoErr(err) => Some(err), + SysinspectError::IoErr(err) => Some(err), _ => None, } } } -impl Display for SyspectError { +impl Display for SysinspectError { fn fmt(&self, f: &mut Formatter<'_>) -> Result { let msg = match self { - SyspectError::ModelMultipleIndex(m) => { + SysinspectError::ModelMultipleIndex(m) => { format!("Another {} file found as '{}'", mspec::MODEL_INDEX, m) } - SyspectError::IoErr(err) => format!("(I/O) {err}"), - SyspectError::SerdeYaml(err) => format!("(YAML) {err}"), - SyspectError::ModelDSLError(err) => format!("(DSL) {err}"), + SysinspectError::IoErr(err) => format!("(I/O) {err}"), + SysinspectError::SerdeYaml(err) => format!("(YAML) {err}"), + SysinspectError::ModelDSLError(err) => format!("(DSL) {err}"), }; write!(f, "{msg}")?; @@ -47,15 +47,15 @@ impl Display for SyspectError { } /// Handle IO errors -impl From for SyspectError { +impl From for SysinspectError { fn from(err: io::Error) -> Self { - SyspectError::IoErr(err) + SysinspectError::IoErr(err) } } /// Handle YAML errors -impl From for SyspectError { +impl From for SysinspectError { fn from(err: serde_yaml::Error) -> Self { - SyspectError::SerdeYaml(err) + SysinspectError::SerdeYaml(err) } } diff --git a/libsysinspect/src/mdl/mspec.rs b/libsysinspect/src/mdl/mspec.rs index 16b6db69..8d49313f 100644 --- a/libsysinspect/src/mdl/mspec.rs +++ b/libsysinspect/src/mdl/mspec.rs @@ -1,4 +1,4 @@ -use crate::SyspectError; +use crate::SysinspectError; use serde_yaml::Value; use std::{fs, path::PathBuf}; use walkdir::WalkDir; @@ -23,7 +23,7 @@ impl SpecLoader { } /// Collect YAML parts of the model from a different files - fn collect_parts(&mut self) -> Result, SyspectError> { + fn collect_parts(&mut self) -> Result, SysinspectError> { let mut out = Vec::::new(); for etr in WalkDir::new(&self.pth).follow_links(true).into_iter().filter_map(Result::ok) { @@ -40,7 +40,7 @@ impl SpecLoader { if fname == MODEL_INDEX { if self.init { - return Err(SyspectError::ModelMultipleIndex(etr.path().as_os_str().to_str().unwrap().to_string())); + return Err(SysinspectError::ModelMultipleIndex(etr.path().as_os_str().to_str().unwrap().to_string())); } else { self.init = true; out.insert(0, serde_yaml::from_str::(&fs::read_to_string(etr.path())?)?); @@ -49,7 +49,7 @@ impl SpecLoader { // Get YAML chunks match serde_yaml::from_str::(&fs::read_to_string(etr.path())?) { Ok(chunk) => out.push(chunk), - Err(err) => return Err(SyspectError::ModelDSLError(format!("Unable to parse {fname}: {err}"))), + Err(err) => return Err(SysinspectError::ModelDSLError(format!("Unable to parse {fname}: {err}"))), } } } @@ -59,9 +59,9 @@ impl SpecLoader { } /// Merge YAML parts - fn merge_parts(&mut self, chunks: &mut Vec) -> Result { + fn merge_parts(&mut self, chunks: &mut Vec) -> Result { if chunks.len() == 0 { - return Err(SyspectError::ModelMultipleIndex("blah happened".to_string())); + return Err(SysinspectError::ModelMultipleIndex("blah happened".to_string())); // XXX: Add one more exception } @@ -86,7 +86,7 @@ impl SpecLoader { // Non-null "b" implies a structure, which is not formed as a key/val, // therefore cannot be added to the DSL root if !b.is_null() { - return Err(SyspectError::ModelDSLError(format!( + return Err(SysinspectError::ModelDSLError(format!( "Mapping expected, but this structure passed: {:?}\n\t > {:?}", a, b ))); @@ -99,13 +99,13 @@ impl SpecLoader { /// Load model spec by merging all the data parts and validating /// its content. - fn load(&mut self) -> Result { + fn load(&mut self) -> Result { let mut parts = self.collect_parts()?; Ok(serde_yaml::from_value(self.merge_parts(&mut parts)?)?) } } /// Load spec from a given path -pub fn load(path: &str) -> Result { +pub fn load(path: &str) -> Result { Ok(SpecLoader::new(path).load()?) } diff --git a/libsysinspect/src/mdl/mspecdef.rs b/libsysinspect/src/mdl/mspecdef.rs index 24a3f550..e1377778 100644 --- a/libsysinspect/src/mdl/mspecdef.rs +++ b/libsysinspect/src/mdl/mspecdef.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; use serde_yaml::Value; -use crate::SyspectError; +use crate::SysinspectError; /// Model Specification /// =================== @@ -34,7 +34,7 @@ pub struct ModelSpec { } impl ModelSpec { - fn find(&self, v: Value) -> Result { + fn find(&self, v: Value) -> Result { match v { /* Value::Sequence(v) => { @@ -54,7 +54,7 @@ impl ModelSpec { _ => {} } - Err(SyspectError::ModelDSLError("Object not found".to_string())) + Err(SysinspectError::ModelDSLError("Object not found".to_string())) } /// Traverse the namespace by "foo:bar:person.name" syntax.