Skip to main content

DBStat

Struct DBStat 

Source
pub struct DBStat<M = Unselected> { /* private fields */ }
Expand description

p4 [g-opts] dbstat [-h][-f] | [-p [-w worklevel] [-n numberOfFiles]] {-a | dbtable ...}

p4 [g-opts] dbstat -s

Displays size or simple statistics for one or more database tables. The dbtable corresponds to the db.* files in your server’s root directory.

The M type parameter tracks the command form at compile time, starting as Unselected from DBStat::new. The available states and transitions are:

Implementations§

Source§

impl DBStat<Unselected>

Source

pub fn new(bin: impl Into<PathBuf>, global_opts: GlobalOpts) -> Self

Creates a new p4 dbstat command.

bin is the path to the Perforce command-line executable. Call one of the form transitions to select a command form.

Source

pub fn show_histogram(self) -> DBStat<Scan<Unselected>>

Enters the scan form with -h enabled: p4 dbstat [-h][-f] {-a | dbtable ...}.

Display a histogram showing distances between leaf pages. This enables you to anticipate disk seeks required for sequential database scans. This scans only the internal node pages of the file, not the leaf or overflow pages, and thus reads only 1-5% of the file.

Note

This option blocks write access to the database while it scans the tables. It is best to get guidance from Perforce Support before using this option.

Use the scan state’s all transition to supply -a; otherwise spawn with a list of table names.

Source

pub fn show_free_pages(self) -> DBStat<Scan<Unselected>>

Enters the scan form with -f enabled: p4 dbstat [-h][-f] {-a | dbtable ...}.

Displays a page count, free pages, and percent free data for the specified tables. Using the -f with the -h option, this command shows a histogram of free page distribution.

Use the scan state’s all transition to supply -a; otherwise spawn with a list of table names.

Source

pub fn all(self) -> DBStat<DisplayAllTables>

§Description

-a

Display statistics for all tables.

Transitions to the DisplayAllTables state, which spawns without table arguments.

Source

pub fn worklevel(self, v: u64) -> DBStat<CheckPoint<Unselected>>

Enters the checkpoint form with -w worklevel set: p4 dbstat -p -w worklevel {-a | dbtable ...}.

The checkpoint form is mutually exclusive with the scan form.

Source

pub fn number_files(self, v: u64) -> DBStat<CheckPoint<Unselected>>

Enters the checkpoint form with -n numberOfFiles set: p4 dbstat -p -n numberOfFiles {-a | dbtable ...}.

The checkpoint form is mutually exclusive with the scan form.

Source

pub fn checkpoint(self) -> DBStat<CheckPoint<Unselected>>

Enters the checkpoint form: p4 dbstat -p [-w worklevel] [-n numberOfFiles] {-a | dbtable ...}.

Use Self::worklevel or Self::number_files to enter the form with -w or -n already set; use Self::all to supply -a, otherwise spawn with a list of table names.

Source

pub fn size(self) -> DBStat<Size>

Enters the size form: p4 dbstat -s.

Source§

impl DBStat<DisplayAllTables>

Source

pub fn show_histogram(self) -> DBStat<Scan<DisplayAllTables>>

Enters the scan form with -h set and -a retained: p4 dbstat [-h][-f] -a.

Source

pub fn show_free_pages(self) -> DBStat<Scan<DisplayAllTables>>

Enters the scan form with -f set and -a retained: p4 dbstat [-h][-f] -a.

Source

pub fn checkpoint(self) -> DBStat<CheckPoint<DisplayAllTables>>

Enters the checkpoint form with -a retained: p4 dbstat -p -a.

Source

pub fn worklevel(self, v: u64) -> DBStat<CheckPoint<DisplayAllTables>>

Enters the checkpoint form with -w worklevel set and -a retained: p4 dbstat -p -w worklevel -a.

Source

pub fn number_files(self, v: u64) -> DBStat<CheckPoint<DisplayAllTables>>

Enters the checkpoint form with -n numberOfFiles set and -a retained: p4 dbstat -p -n numberOfFiles -a.

Source§

impl<M> DBStat<Scan<M>>

Source

pub fn get_show_histogram(&self) -> bool

§Description

-h

Display a histogram showing distances between leaf pages. This enables you to anticipate disk seeks required for sequential database scans. This scans only the internal node pages of the file, not the leaf or overflow pages, and thus reads only 1-5% of the file.

Note

This option blocks write access to the database while it scans the tables. It is best to get guidance from Perforce Support before using this option.

Source

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

§Description

-h

Display a histogram showing distances between leaf pages. This enables you to anticipate disk seeks required for sequential database scans. This scans only the internal node pages of the file, not the leaf or overflow pages, and thus reads only 1-5% of the file.

Note

This option blocks write access to the database while it scans the tables. It is best to get guidance from Perforce Support before using this option.

Source

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

§Description

-h

Display a histogram showing distances between leaf pages. This enables you to anticipate disk seeks required for sequential database scans. This scans only the internal node pages of the file, not the leaf or overflow pages, and thus reads only 1-5% of the file.

Note

This option blocks write access to the database while it scans the tables. It is best to get guidance from Perforce Support before using this option.

Source

pub fn get_show_free_pages(&self) -> bool

§Description

-f

Displays a page count, free pages, and percent free data for the specified tables. Using the -f with the -h option, this command shows a histogram of free page distribution.

Source

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

§Description

-f

Displays a page count, free pages, and percent free data for the specified tables. Using the -f with the -h option, this command shows a histogram of free page distribution.

Source

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

§Description

-f

Displays a page count, free pages, and percent free data for the specified tables. Using the -f with the -h option, this command shows a histogram of free page distribution.

Source§

impl DBStat<Scan<Unselected>>

Source

pub fn all(self) -> DBStat<Scan<DisplayAllTables>>

§Description

-a

Display statistics for all tables.

Transitions to the DisplayAllTables state, which spawns without table arguments.

Source§

impl<M> DBStat<CheckPoint<M>>

Source

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

§Description

-w worklevel

The worklevel determines which level of the table should be used to split the table. This option overrides the db.checkpoint.worklevel configurable so you can specify the worklevel at the command line.

Source

pub fn set_worklevel(&mut self, v: u64) -> &mut Self

§Description

-w worklevel

The worklevel determines which level of the table should be used to split the table. This option overrides the db.checkpoint.worklevel configurable so you can specify the worklevel at the command line.

Source

pub fn worklevel(self, v: u64) -> Self

§Description

-w worklevel

The worklevel determines which level of the table should be used to split the table. This option overrides the db.checkpoint.worklevel configurable so you can specify the worklevel at the command line.

Source

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

§Description

-n numberOfFiles

This option determines, along with the depth of the database table, the number of checkpoint files that would be generated. A large table might contain multiple pages. The -n numberOfFiles requested makes it possible divide the page count to split each chunk of work into similar sizes. This option overrides the db.checkpoint.numfiles configurable so you can specify numberOfFiles at the command line.

Source

pub fn set_number_files(&mut self, v: u64) -> &mut Self

§Description

-n numberOfFiles

This option determines, along with the depth of the database table, the number of checkpoint files that would be generated. A large table might contain multiple pages. The -n numberOfFiles requested makes it possible divide the page count to split each chunk of work into similar sizes. This option overrides the db.checkpoint.numfiles configurable so you can specify numberOfFiles at the command line.

Source

pub fn number_files(self, v: u64) -> Self

§Description

-n numberOfFiles

This option determines, along with the depth of the database table, the number of checkpoint files that would be generated. A large table might contain multiple pages. The -n numberOfFiles requested makes it possible divide the page count to split each chunk of work into similar sizes. This option overrides the db.checkpoint.numfiles configurable so you can specify numberOfFiles at the command line.

Source§

impl DBStat<CheckPoint<Unselected>>

Source

pub fn all(self) -> DBStat<CheckPoint<DisplayAllTables>>

§Description

-a

Display statistics for all tables.

Transitions to the DisplayAllTables state, which spawns without table arguments.

Source§

impl<M> DBStat<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_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 DBStat<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 DBStat<M>

Source§

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

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

impl<M: Default> Default for DBStat<M>

Source§

fn default() -> Self

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

impl ParameterizedSpawn<()> for DBStat<DisplayAllTables>

Source§

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

Spawns p4 dbstat -a 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 ParameterizedSpawn<()> for DBStat<Scan<DisplayAllTables>>

Source§

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

Spawns p4 dbstat -a 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 ParameterizedSpawn<()> for DBStat<CheckPoint<DisplayAllTables>>

Available on non-crate feature lt2023_1 only.
Source§

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

Spawns p4 dbstat -p -a 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 ParameterizedSpawn<()> for DBStat<Size>

Source§

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

Spawns p4 dbstat -s 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<S, I> ParameterizedSpawn<(S,)> for DBStat<Unselected>
where S: IntoIterator<Item = I>, I: AsRef<OsStr>,

Source§

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

Spawns p4 dbstat for the given tables 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<S, I> ParameterizedSpawn<(S,)> for DBStat<Scan<Unselected>>
where S: IntoIterator<Item = I>, I: AsRef<OsStr>,

Source§

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

Spawns p4 dbstat for the given tables 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<S, I> ParameterizedSpawn<(S,)> for DBStat<CheckPoint<Unselected>>
where S: IntoIterator<Item = I>, I: AsRef<OsStr>,

Available on non-crate feature lt2023_1 only.
Source§

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

Spawns p4 dbstat -p for the given tables 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> SubCommand for DBStat<M>
where M: ExclusiveOption,

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 DBStat<M>
where M: Freeze,

§

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

§

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

§

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

§

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

§

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

§

impl<M> UnwindSafe for DBStat<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, T1> OutputExt1<T1> for T
where T: SpawnExt1<T1, Output = Child, Error = Error>,

Source§

fn output( &mut self, a: T1, ) -> Result<Output, <T as ParameterizedSpawn<(T1,)>>::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, T1> SpawnExt1<T1> for T

Source§

fn spawn( &mut self, a: T1, ) -> Result<<T as ParameterizedSpawn<(T1,)>>::Output, <T as ParameterizedSpawn<(T1,)>>::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.