Skip to main content

Cli

Struct Cli 

Source
struct Cli {
Show 19 fields pid: Option<i32>, interval: Option<u64>, config: String, format: OutputFormat, output: Option<String>, quiet: bool, project_name: Option<String>, job_name: Option<String>, stage_name: Option<String>, task_name: Option<String>, team: Option<String>, env: Option<String>, language: Option<String>, orchestrator: Option<String>, executor: Option<String>, external_run_id: Option<String>, container_image: Option<String>, tags: Vec<String>, command: Vec<String>,
}

Fields§

§pid: Option<i32>

Root PID of the process tree to track CPU usage for. Overridden automatically in shell-wrapper mode.

§interval: Option<u64>

Polling interval in seconds (must be >= 1).

§config: String

Path to TOML config file.

§format: OutputFormat

Output format: json (default) or csv.

§output: Option<String>

Write metric output to FILE instead of stdout. Useful in shell-wrapper mode to keep the tracked app’s stdout clean.

§quiet: bool

Suppress metric output entirely (no stdout, no file). Useful when streaming to Sentinel and local output is not needed.

§project_name: Option<String>

Project name for Sentinel run registration.

§job_name: Option<String>

Job name attached to every sample and to the Sentinel run record.

§stage_name: Option<String>

Stage name (e.g. “train”, “eval”) for Sentinel run registration.

§task_name: Option<String>

Task name for Sentinel run registration.

§team: Option<String>

Team name for Sentinel run registration.

§env: Option<String>

Environment label (e.g. “prod”, “staging”) for Sentinel run registration.

§language: Option<String>

Programming language label for Sentinel run registration.

§orchestrator: Option<String>

Orchestrator label (e.g. “airflow”, “prefect”) for Sentinel run registration.

§executor: Option<String>

Executor label (e.g. “kubernetes”, “slurm”) for Sentinel run registration.

§external_run_id: Option<String>

External run ID from the calling system for Sentinel run registration.

§container_image: Option<String>

Container image name/tag for Sentinel run registration.

§tags: Vec<String>

Arbitrary key=value tag. May be repeated: –tag key1=val1 –tag key2=val2

§command: Vec<String>

Command to spawn and monitor. All tokens after – are the command + args. Example: resource-tracker – Rscript model.R –epochs 10

Trait Implementations§

Source§

impl Args for Cli

Source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate self via [FromArgMatches::update_from_arg_matches_mut] Read more
Source§

impl CommandFactory for Cli

Source§

fn command<'b>() -> Command

Build a [Command] that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a [Command] that can update self. Read more
Source§

impl Debug for Cli

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Cli

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for Cli

§

fn parse() -> Self

Parse from std::env::args_os(), [exit][Error::exit] on error.
§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, [exit][Error::exit] on error.
§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, [exit][Error::exit] on error. Read more
§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

§

impl Freeze for Cli

§

impl RefUnwindSafe for Cli

§

impl Send for Cli

§

impl Sync for Cli

§

impl Unpin for Cli

§

impl UnsafeUnpin for Cli

§

impl UnwindSafe for Cli

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.