pub trait SzDiagnostic: Send + Sync {
// Required methods
fn check_repository_performance(
&self,
seconds_to_run: i64,
) -> SzResult<JsonString>;
fn get_feature(&self, feature_id: FeatureId) -> SzResult<JsonString>;
fn get_repository_info(&self) -> SzResult<JsonString>;
fn purge_repository(&self) -> SzResult<()>;
}Expand description
System diagnostics and monitoring.
The SzDiagnostic trait provides methods for system health monitoring,
performance analysis, and repository maintenance.
§Obtaining an Instance
use sz_rust_sdk::prelude::*;
let diagnostic = env.get_diagnostic()?;Required Methods§
Sourcefn check_repository_performance(
&self,
seconds_to_run: i64,
) -> SzResult<JsonString>
fn check_repository_performance( &self, seconds_to_run: i64, ) -> SzResult<JsonString>
Runs a performance benchmark on the repository.
Executes read operations against the repository to measure performance characteristics. Useful for baseline testing and capacity planning.
§Arguments
seconds_to_run- Duration of the benchmark in seconds
§Returns
JSON string with performance metrics including operations per second.
§Examples
use sz_rust_sdk::prelude::*;
let diagnostic = env.get_diagnostic()?;
let result = diagnostic.check_repository_performance(1)?;
println!("Performance: {}", result);§Errors
SzError::BadInput- Invalid duration (must be positive)
Sourcefn get_feature(&self, feature_id: FeatureId) -> SzResult<JsonString>
fn get_feature(&self, feature_id: FeatureId) -> SzResult<JsonString>
Gets detailed information about a specific feature.
Retrieves internal feature data useful for debugging entity resolution decisions. Features are the normalized attributes extracted from records.
§Arguments
feature_id- Internal feature identifier
§Returns
JSON string with feature details including type, value, and usage statistics.
§Examples
use sz_rust_sdk::prelude::*;
let diagnostic = env.get_diagnostic()?;
let feature_id = 1; // obtained from entity resolution results
let result = diagnostic.get_feature(feature_id)?;
println!("Feature: {}", result);§Errors
SzError::NotFound- Feature ID does not exist
Sourcefn get_repository_info(&self) -> SzResult<JsonString>
fn get_repository_info(&self) -> SzResult<JsonString>
Gets repository statistics and information.
Returns aggregate information about the entity repository including record counts, entity counts, and data source statistics.
§Returns
JSON string with repository statistics.
§Examples
use sz_rust_sdk::prelude::*;
let diagnostic = env.get_diagnostic()?;
let info = diagnostic.get_repository_info()?;
println!("Repository info: {}", info);Sourcefn purge_repository(&self) -> SzResult<()>
fn purge_repository(&self) -> SzResult<()>
Purges all entity data from the repository.
Removes all records and entities while preserving configuration. Use with caution - this operation is irreversible.
§Warning
This permanently deletes all entity resolution data. Configuration and data source definitions are preserved.
§Examples
use sz_rust_sdk::prelude::*;
let diagnostic = env.get_diagnostic()?;
diagnostic.purge_repository()?;