Skip to main content

Diagnostics

Struct Diagnostics 

Source
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 the p4 info and p4 servers -J commands, 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>

Source

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.

Source

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.

Source

pub fn json_format(self) -> Diagnostics<Basic<Unselected>>

§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.

Enters the Basic form of the command.

Source

pub fn journal(self) -> Diagnostics<Basic<Journal>>

§Description

-J [-L limit]

Downloads a copy of the current journal file and log file, using the configured names of these files.

Enters the Basic form of the command with the Journal state selected.

Source

pub fn advance_with_basic( self, ) -> Diagnostics<Advance<Unselected, WithBasic<Unselected>>>

§Description

-a

Requests that the basic diagnostic files are produced. Without this option, those files are omitted with the -l, -t, -p, and -s options.

Enters the Advance form of the command with the WithBasic state selected.

Source

pub fn run_lsof(self) -> Diagnostics<Advance<Unselected, Unselected>>

§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.

Enters the Advance form of the command.

Source

pub fn run_ps(self) -> Diagnostics<Advance<Unselected, Unselected>>

§Description

-p

Run the ps program and returns its output.

Enters the Advance form of the command.

Source

pub fn run_top(self) -> Diagnostics<Advance<Unselected, Unselected>>

§Description

-t

Run the top program and returns its output.

Enters the Advance form of the command.

Source

pub fn run_strace(self) -> Diagnostics<Advance<Strace, Unselected>>

§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.

Enters the Advance form of the command with the Strace state selected.

Source

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>>

Source

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.

Source

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.

Source

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>>

Source

pub fn journal(self) -> Diagnostics<Basic<Journal>>

§Description

-J [-L limit]

Downloads a copy of the current journal file and log file, using the configured names of these files.

Enters the Basic form of the command with the Journal state selected.

Source

pub fn journal_with( self, limit: impl Into<String>, ) -> Diagnostics<Basic<Journal>>

§Description

-J [-L limit]

Downloads a copy of the current journal file and log file, using the configured names of these files.

Enters the Basic form of the command with the Journal state selected and the download limited to limit.

Source§

impl Diagnostics<Basic<Journal>>

Source

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.

Source

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.

Source

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>>

Source

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.

Source

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.

Source

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.

Source

pub fn get_run_ps(&self) -> bool

§Description

-p

Run the ps program and returns its output.

Source

pub fn set_run_ps(&mut self, v: bool) -> &mut Self

§Description

-p

Run the ps program and returns its output.

Source

pub fn run_ps(self, v: bool) -> Self

§Description

-p

Run the ps program and returns its output.

Source

pub fn get_run_top(&self) -> bool

§Description

-t

Run the top program and returns its output.

Source

pub fn set_run_top(&mut self, v: bool) -> &mut Self

§Description

-t

Run the top program and returns its output.

Source

pub fn run_top(self, v: bool) -> Self

§Description

-t

Run the top program and returns its output.

Source

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.

Source

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>>

Source

pub fn with_basic(self) -> Diagnostics<Advance<S, WithBasic<Unselected>>>

§Description

-a

Requests that the basic diagnostic files are produced. Without this option, those files are omitted with the -l, -t, -p, and -s options.

Transitions this command to the WithBasic state.

Source§

impl<S: ExclusiveOption> Diagnostics<Advance<S, WithBasic<Unselected>>>

Source

pub fn journal(self) -> Diagnostics<Advance<S, WithBasic<Journal>>>

§Description

-J [-L limit]

Downloads a copy of the current journal file and log file, using the configured names of these files.

Transitions this command to the Journal state.

Source

pub fn journal_with( self, limit: impl Into<String>, ) -> Diagnostics<Advance<S, WithBasic<Journal>>>

§Description

-J [-L limit]

Downloads a copy of the current journal file and log file, using the configured names of these files.

Transitions this command to the Journal state with the download limited to limit.

Source§

impl<S: ExclusiveOption> Diagnostics<Advance<S, WithBasic<Journal>>>

Source

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.

Source

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.

Source

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>>

Source

pub fn get_strace_runtime(&self) -> Option<u64>

§Description

--strace-runtime secs

Run the strace command for secs seconds instead of the default 20.

Source

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.

Source

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>

Source

pub fn get_bin(&self) -> &Path

Get the Perforce command path.

Source

pub fn set_bin(&mut self, bin: impl Into<PathBuf>) -> &mut Self

Set the Perforce command path.

Source

pub fn bin(self, bin: impl Into<PathBuf>) -> Self

Set the Perforce command path.

Source

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.

Source

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.

Source

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.

Source

pub fn get_global_opts(&self) -> &GlobalOpts

§Description

g-opts

See Global options.

Source

pub fn set_global_opts(&mut self, v: GlobalOpts) -> &mut Self

§Description

g-opts

See Global options.

Source

pub fn global_opts(self, v: GlobalOpts) -> Self

§Description

g-opts

See Global options.

Trait Implementations§

Source§

impl<M: Clone> Clone for Diagnostics<M>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<M: Debug> Debug for Diagnostics<M>

Source§

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

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

impl<M: Default> Default for Diagnostics<M>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<M: ExclusiveOption> ParameterizedSpawn<()> for Diagnostics<M>

Source§

fn spawn_with(&mut self, (): ()) -> Result<Self::Output, Self::Error>

Spawns p4 diagnostics as a child process with piped standard output and error streams; use the returned Child handle to wait for it or interact with it.

Source§

type Output = Child

Source§

type Error = Error

Source§

impl<M: ExclusiveOption> SubCommand for Diagnostics<M>

Source§

fn name(&self) -> &str

Source§

fn inject_local_args(&self, command: &mut Command)

Source§

fn global_opts(&self) -> Option<&GlobalOpts>

Source§

fn inject_args(&self, command: &mut Command)

Source§

fn setup_command<S: AsRef<OsStr>>(&self, bin: S) -> Command

Auto Trait Implementations§

§

impl<M> Freeze for Diagnostics<M>
where M: Freeze,

§

impl<M> RefUnwindSafe for Diagnostics<M>
where M: RefUnwindSafe,

§

impl<M> Send for Diagnostics<M>
where M: Send,

§

impl<M> Sync for Diagnostics<M>
where M: Sync,

§

impl<M> Unpin for Diagnostics<M>
where M: Unpin,

§

impl<M> UnsafeUnpin for Diagnostics<M>
where M: UnsafeUnpin,

§

impl<M> UnwindSafe for Diagnostics<M>
where M: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> OutputExt for T
where T: SpawnExt<Output = Child, Error = Error>,

Source§

impl<T, I> ParameterizedOutput<I> for T
where T: ParameterizedSpawn<I, Output = Child, Error = Error>,

Source§

type Error = Error

Source§

fn output_with( &mut self, input: I, ) -> Result<Output, <T as ParameterizedOutput<I>>::Error>

Source§

impl<T> SpawnExt for T

Source§

fn spawn( &mut self, ) -> Result<<T as ParameterizedSpawn<()>>::Output, <T as ParameterizedSpawn<()>>::Error>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.