pub struct Diagnostics<M = Unselected> { /* private fields */ }Expand description
p4 [g-opts] diagnostics [-D] [-j] [-J [-L limit]]
p4 [g-opts] diagnostics [-D] [-l] [-s [--strace-runtime secs]] [-p] [-t] [-a [-J [-L limit]]]
Generate diagnostic data about the P4 Server.
The first form of the command generates the basic diagnostic data, and downloads a compressed tar file (.tgz) that contains these files:
diags- basic configuration details, configuration, configuration history, server setting.info- tagged output from thep4 infoandp4 servers -Jcommands, and a list of all non-default configurables.monitor- the monitor records, if monitoring is enabled.topology- a textual description of the network that contains this server. Servers that do not have a serverID are ignored.
The second form of the command provides information that might take more time and require more server resources.
The M type parameter tracks the command form at compile time. The default Unselected state selects the basic form with no local options; journal, json_format, and basic enter the Basic state, while advance, advance_with_basic, and the run_* transitions enter the Advance state.
Implementations§
Source§impl Diagnostics<Unselected>
impl Diagnostics<Unselected>
Sourcepub fn new(bin: impl Into<PathBuf>, global_opts: GlobalOpts) -> Self
pub fn new(bin: impl Into<PathBuf>, global_opts: GlobalOpts) -> Self
Creates a new p4 diagnostics command.
bin is the path to the Perforce command-line executable.
Sourcepub fn basic(self) -> Diagnostics<Basic<Unselected>>
pub fn basic(self) -> Diagnostics<Basic<Unselected>>
Enters the Basic form of the command with no local options
selected; equivalent to the default Unselected state.
Sourcepub fn json_format(self) -> Diagnostics<Basic<Unselected>>
pub fn json_format(self) -> Diagnostics<Basic<Unselected>>
Sourcepub fn journal(self) -> Diagnostics<Basic<Journal>>
pub fn journal(self) -> Diagnostics<Basic<Journal>>
Sourcepub fn advance_with_basic(
self,
) -> Diagnostics<Advance<Unselected, WithBasic<Unselected>>>
pub fn advance_with_basic( self, ) -> Diagnostics<Advance<Unselected, WithBasic<Unselected>>>
Sourcepub fn run_lsof(self) -> Diagnostics<Advance<Unselected, Unselected>>
pub fn run_lsof(self) -> Diagnostics<Advance<Unselected, Unselected>>
Sourcepub fn run_ps(self) -> Diagnostics<Advance<Unselected, Unselected>>
pub fn run_ps(self) -> Diagnostics<Advance<Unselected, Unselected>>
Sourcepub fn run_top(self) -> Diagnostics<Advance<Unselected, Unselected>>
pub fn run_top(self) -> Diagnostics<Advance<Unselected, Unselected>>
Sourcepub fn run_strace(self) -> Diagnostics<Advance<Strace, Unselected>>
pub fn run_strace(self) -> Diagnostics<Advance<Strace, Unselected>>
Sourcepub fn run_strace_with(
self,
runtime: u64,
) -> Diagnostics<Advance<Strace, Unselected>>
pub fn run_strace_with( self, runtime: u64, ) -> Diagnostics<Advance<Strace, Unselected>>
§Description
-s --strace-runtime secs
Run an strace command on the server processes for secs seconds
instead of the default 20. The data from this operation is
downloaded into a file named strace.
The strace Linux command is not supported on Windows.
Enters the Advance form of the command with the Strace state
selected.
Source§impl<J: ExclusiveOption> Diagnostics<Basic<J>>
impl<J: ExclusiveOption> Diagnostics<Basic<J>>
Sourcepub fn get_json_format(&self) -> bool
pub fn get_json_format(&self) -> bool
§Description
-j
Request that the diags and monitor files are encoded in JSON
format. These output files are named diags.json and monitor.json.
Any non-UFT8 sequences in a string are replaced by U+FFFD in the JSON
output.
Sourcepub fn set_json_format(&mut self, v: bool) -> &mut Self
pub fn set_json_format(&mut self, v: bool) -> &mut Self
§Description
-j
Request that the diags and monitor files are encoded in JSON
format. These output files are named diags.json and monitor.json.
Any non-UFT8 sequences in a string are replaced by U+FFFD in the JSON
output.
Sourcepub fn json_format(self, v: bool) -> Self
pub fn json_format(self, v: bool) -> Self
§Description
-j
Request that the diags and monitor files are encoded in JSON
format. These output files are named diags.json and monitor.json.
Any non-UFT8 sequences in a string are replaced by U+FFFD in the JSON
output.
Source§impl Diagnostics<Basic<Unselected>>
impl Diagnostics<Basic<Unselected>>
Sourcepub fn journal(self) -> Diagnostics<Basic<Journal>>
pub fn journal(self) -> Diagnostics<Basic<Journal>>
Sourcepub fn journal_with(
self,
limit: impl Into<String>,
) -> Diagnostics<Basic<Journal>>
pub fn journal_with( self, limit: impl Into<String>, ) -> Diagnostics<Basic<Journal>>
Source§impl Diagnostics<Basic<Journal>>
impl Diagnostics<Basic<Journal>>
Sourcepub fn get_limit(&self) -> Option<&str>
pub fn get_limit(&self) -> Option<&str>
§Description
-L limit
Limit the download size of the journal and log files to the last
limit number of bytes of these files, subject to buffer rounding. The
limit is in bytes and can be suffixed with a single character to
designate a unit multiplier: k or K for kilobytes, m or M for
megabytes, g or G for gigabytes, and t or T for terabytes.
Sourcepub fn set_limit(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_limit(&mut self, v: impl Into<String>) -> &mut Self
§Description
-L limit
Limit the download size of the journal and log files to the last
limit number of bytes of these files, subject to buffer rounding. The
limit is in bytes and can be suffixed with a single character to
designate a unit multiplier: k or K for kilobytes, m or M for
megabytes, g or G for gigabytes, and t or T for terabytes.
Sourcepub fn limit(self, v: impl Into<String>) -> Self
pub fn limit(self, v: impl Into<String>) -> Self
§Description
-L limit
Limit the download size of the journal and log files to the last
limit number of bytes of these files, subject to buffer rounding. The
limit is in bytes and can be suffixed with a single character to
designate a unit multiplier: k or K for kilobytes, m or M for
megabytes, g or G for gigabytes, and t or T for terabytes.
Source§impl<S: ExclusiveOption, B: ExclusiveOption> Diagnostics<Advance<S, B>>
impl<S: ExclusiveOption, B: ExclusiveOption> Diagnostics<Advance<S, B>>
Sourcepub fn get_run_lsof(&self) -> bool
pub fn get_run_lsof(&self) -> bool
§Description
-l
Request that the /usr/bin/lsof be run to provide locking details of
all files in use by P4 Servers on this system.
The data from this operation is downloaded into a file named manuallocks.
This option is not supported on Windows.
Sourcepub fn set_run_lsof(&mut self, v: bool) -> &mut Self
pub fn set_run_lsof(&mut self, v: bool) -> &mut Self
§Description
-l
Request that the /usr/bin/lsof be run to provide locking details of
all files in use by P4 Servers on this system.
The data from this operation is downloaded into a file named manuallocks.
This option is not supported on Windows.
Sourcepub fn run_lsof(self, v: bool) -> Self
pub fn run_lsof(self, v: bool) -> Self
§Description
-l
Request that the /usr/bin/lsof be run to provide locking details of
all files in use by P4 Servers on this system.
The data from this operation is downloaded into a file named manuallocks.
This option is not supported on Windows.
Sourcepub fn get_run_ps(&self) -> bool
pub fn get_run_ps(&self) -> bool
Sourcepub fn set_run_ps(&mut self, v: bool) -> &mut Self
pub fn set_run_ps(&mut self, v: bool) -> &mut Self
Sourcepub fn get_run_top(&self) -> bool
pub fn get_run_top(&self) -> bool
Sourcepub fn set_run_top(&mut self, v: bool) -> &mut Self
pub fn set_run_top(&mut self, v: bool) -> &mut Self
Sourcepub fn run_strace(self) -> Diagnostics<Advance<Strace, B>>
pub fn run_strace(self) -> Diagnostics<Advance<Strace, B>>
§Description
-s
Run an strace command on the server processes for 20 seconds. The data from this operation is downloaded into a file named strace. The strace Linux command is not supported on Windows.
Sourcepub fn run_strace_with(self, runtime: u64) -> Diagnostics<Advance<Strace, B>>
pub fn run_strace_with(self, runtime: u64) -> Diagnostics<Advance<Strace, B>>
§Description
-s --strace-runtime secs
Run an strace command on the server processes for secs seconds
instead of the default 20. The data from this operation is
downloaded into a file named strace.
The strace Linux command is not supported on Windows.
Source§impl<S: ExclusiveOption> Diagnostics<Advance<S, Unselected>>
impl<S: ExclusiveOption> Diagnostics<Advance<S, Unselected>>
Sourcepub fn with_basic(self) -> Diagnostics<Advance<S, WithBasic<Unselected>>>
pub fn with_basic(self) -> Diagnostics<Advance<S, WithBasic<Unselected>>>
Source§impl<S: ExclusiveOption> Diagnostics<Advance<S, WithBasic<Unselected>>>
impl<S: ExclusiveOption> Diagnostics<Advance<S, WithBasic<Unselected>>>
Sourcepub fn journal_with(
self,
limit: impl Into<String>,
) -> Diagnostics<Advance<S, WithBasic<Journal>>>
pub fn journal_with( self, limit: impl Into<String>, ) -> Diagnostics<Advance<S, WithBasic<Journal>>>
Source§impl<S: ExclusiveOption> Diagnostics<Advance<S, WithBasic<Journal>>>
impl<S: ExclusiveOption> Diagnostics<Advance<S, WithBasic<Journal>>>
Sourcepub fn get_limit(&self) -> Option<&str>
pub fn get_limit(&self) -> Option<&str>
§Description
-L limit
Limit the download size of the journal and log files to the last
limit number of bytes of these files, subject to buffer rounding. The
limit is in bytes and can be suffixed with a single character to
designate a unit multiplier: k or K for kilobytes, m or M for
megabytes, g or G for gigabytes, and t or T for terabytes.
Sourcepub fn set_limit(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_limit(&mut self, v: impl Into<String>) -> &mut Self
§Description
-L limit
Limit the download size of the journal and log files to the last
limit number of bytes of these files, subject to buffer rounding. The
limit is in bytes and can be suffixed with a single character to
designate a unit multiplier: k or K for kilobytes, m or M for
megabytes, g or G for gigabytes, and t or T for terabytes.
Sourcepub fn limit(self, v: impl Into<String>) -> Self
pub fn limit(self, v: impl Into<String>) -> Self
§Description
-L limit
Limit the download size of the journal and log files to the last
limit number of bytes of these files, subject to buffer rounding. The
limit is in bytes and can be suffixed with a single character to
designate a unit multiplier: k or K for kilobytes, m or M for
megabytes, g or G for gigabytes, and t or T for terabytes.
Source§impl<B: ExclusiveOption> Diagnostics<Advance<Strace, B>>
impl<B: ExclusiveOption> Diagnostics<Advance<Strace, B>>
Sourcepub fn get_strace_runtime(&self) -> Option<u64>
pub fn get_strace_runtime(&self) -> Option<u64>
§Description
--strace-runtime secs
Run the strace command for secs seconds instead of the default 20.
Sourcepub fn set_strace_runtime(&mut self, v: u64) -> &mut Self
pub fn set_strace_runtime(&mut self, v: u64) -> &mut Self
§Description
--strace-runtime secs
Run the strace command for secs seconds instead of the default 20.
Sourcepub fn strace_runtime(self, v: u64) -> Self
pub fn strace_runtime(self, v: u64) -> Self
§Description
--strace-runtime secs
Run the strace command for secs seconds instead of the default 20.
Source§impl<M: ExclusiveOption> Diagnostics<M>
impl<M: ExclusiveOption> Diagnostics<M>
Sourcepub fn get_uncompressed(&self) -> bool
pub fn get_uncompressed(&self) -> bool
§Description
-D
Create a new directory and download the requested uncompressed individual files into this new directory. Without this option, download a single compressed tar file.
Sourcepub fn set_uncompressed(&mut self, v: bool) -> &mut Self
pub fn set_uncompressed(&mut self, v: bool) -> &mut Self
§Description
-D
Create a new directory and download the requested uncompressed individual files into this new directory. Without this option, download a single compressed tar file.
Sourcepub fn uncompressed(self, v: bool) -> Self
pub fn uncompressed(self, v: bool) -> Self
§Description
-D
Create a new directory and download the requested uncompressed individual files into this new directory. Without this option, download a single compressed tar file.