pub struct Config {
pub hostname: String,
pub delay: u64,
pub server: bool,
pub client_time_from: String,
pub client_sort_by: String,
}Expand description
Config struct holds the user input when running the server. It is a bad design to hold the client’s option as well in the same struct, but as of now, it is here.
Fields§
§hostname: Stringhostname of the server. This is derived by this crate from the hostname crate.
delay: u64Delay decides how many seconds to sleep after each iteration of scanning /proc
server: boolIf true, runs as server. Defaults to false. Pass the subcommand server to set it to true.
client_time_from: StringThe time from which the client can fetch data to process.
client_sort_by: StringSort the processed data by whatever the user wants.
Implementations§
Source§impl Config
Returns a new config object. This also gives the following command line argument options.
impl Config
Returns a new config object. This also gives the following command line argument options.
§Examples
Here are the cli options used to populate the struct.
sudo target/debug/procshot –help
procshot 1.0
nohupped@gmail.com
Snapshots proc periodically. All the options except delay works when 'server' option is not used.
USAGE:
procshot [FLAGS] [OPTIONS] [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-o Sort result by Memory or CPU. Accepted values are...
-t Read stats from a specific time. Accepted format: 2015-09-05 23:56:04
-V, --version Prints version information
OPTIONS:
-d, --delay <delay> Sets delay in seconds before it scans /proc every time. [default: 60]
SUBCOMMANDS:
help Prints this message or the help of the given subcommand(s)
server Decides whether to run as server or clientTrait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more