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:
Unselected/DisplayAllTables: the bare{-a | dbtable ...}selection tail; spawn the former with a list of table names, or useSelf::allto supply-aand spawn the latter with(). Both states can enter the scan and checkpoint forms; the transitions defined onDisplayAllTableskeep-a.Scan(entered viaSelf::show_histogramorSelf::show_free_pages): histogram and free-page options followed by a table selection;Self::allsupplies-aand transitions to theDisplayAllTablesstate.CheckPoint(entered viaSelf::checkpoint):-pwith optional-w/-n; mutually exclusive with the scan form.Size(entered viaSelf::size): the-sform.
Implementations§
Source§impl DBStat<Unselected>
impl DBStat<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 dbstat command.
bin is the path to the Perforce command-line executable. Call one of
the form transitions to select a command form.
Sourcepub fn show_histogram(self) -> DBStat<Scan<Unselected>>
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.
Sourcepub fn show_free_pages(self) -> DBStat<Scan<Unselected>>
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.
Sourcepub fn all(self) -> DBStat<DisplayAllTables>
pub fn all(self) -> DBStat<DisplayAllTables>
§Description
-a
Display statistics for all tables.
Transitions to the DisplayAllTables state, which spawns without
table arguments.
Sourcepub fn worklevel(self, v: u64) -> DBStat<CheckPoint<Unselected>>
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.
Sourcepub fn number_files(self, v: u64) -> DBStat<CheckPoint<Unselected>>
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.
Sourcepub fn checkpoint(self) -> DBStat<CheckPoint<Unselected>>
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§impl DBStat<DisplayAllTables>
impl DBStat<DisplayAllTables>
Sourcepub fn show_histogram(self) -> DBStat<Scan<DisplayAllTables>>
pub fn show_histogram(self) -> DBStat<Scan<DisplayAllTables>>
Enters the scan form with -h set and -a retained:
p4 dbstat [-h][-f] -a.
Sourcepub fn show_free_pages(self) -> DBStat<Scan<DisplayAllTables>>
pub fn show_free_pages(self) -> DBStat<Scan<DisplayAllTables>>
Enters the scan form with -f set and -a retained:
p4 dbstat [-h][-f] -a.
Sourcepub fn checkpoint(self) -> DBStat<CheckPoint<DisplayAllTables>>
pub fn checkpoint(self) -> DBStat<CheckPoint<DisplayAllTables>>
Enters the checkpoint form with -a retained: p4 dbstat -p -a.
Sourcepub fn worklevel(self, v: u64) -> DBStat<CheckPoint<DisplayAllTables>>
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.
Sourcepub fn number_files(self, v: u64) -> DBStat<CheckPoint<DisplayAllTables>>
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>>
impl<M> DBStat<Scan<M>>
Sourcepub fn get_show_histogram(&self) -> bool
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.
Sourcepub fn set_show_histogram(&mut self, v: bool) -> &mut Self
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.
Sourcepub fn show_histogram(self, v: bool) -> Self
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.
Sourcepub fn get_show_free_pages(&self) -> bool
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.
Sourcepub fn set_show_free_pages(&mut self, v: bool) -> &mut Self
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.
Sourcepub fn show_free_pages(self, v: bool) -> Self
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>>
impl DBStat<Scan<Unselected>>
Sourcepub fn all(self) -> DBStat<Scan<DisplayAllTables>>
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>>
impl<M> DBStat<CheckPoint<M>>
Sourcepub fn get_worklevel(&self) -> Option<u64>
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.
Sourcepub fn set_worklevel(&mut self, v: u64) -> &mut Self
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.
Sourcepub fn worklevel(self, v: u64) -> Self
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.
Sourcepub fn get_number_files(&self) -> Option<u64>
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.
Sourcepub fn set_number_files(&mut self, v: u64) -> &mut Self
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.
Sourcepub fn number_files(self, v: u64) -> Self
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>>
impl DBStat<CheckPoint<Unselected>>
Sourcepub fn all(self) -> DBStat<CheckPoint<DisplayAllTables>>
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>
impl<M> DBStat<M>
Sourcepub fn get_global_opts(&self) -> &GlobalOpts
pub fn get_global_opts(&self) -> &GlobalOpts
Sourcepub fn set_global_opts(&mut self, v: GlobalOpts) -> &mut Self
pub fn set_global_opts(&mut self, v: GlobalOpts) -> &mut Self
Sourcepub fn global_opts(self, v: GlobalOpts) -> Self
pub fn global_opts(self, v: GlobalOpts) -> Self
Trait Implementations§
Source§impl ParameterizedSpawn<()> for DBStat<DisplayAllTables>
impl ParameterizedSpawn<()> for DBStat<DisplayAllTables>
Source§impl ParameterizedSpawn<()> for DBStat<Scan<DisplayAllTables>>
impl ParameterizedSpawn<()> for DBStat<Scan<DisplayAllTables>>
Source§impl ParameterizedSpawn<()> for DBStat<CheckPoint<DisplayAllTables>>
Available on non-crate feature lt2023_1 only.
impl ParameterizedSpawn<()> for DBStat<CheckPoint<DisplayAllTables>>
lt2023_1 only.Source§impl<S, I> ParameterizedSpawn<(S,)> for DBStat<Unselected>
impl<S, I> ParameterizedSpawn<(S,)> for DBStat<Unselected>
Source§fn spawn_with(&mut self, (tables): (S,)) -> Result<Self::Output, Self::Error>
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.
type Output = Child
type Error = Error
Source§impl<S, I> ParameterizedSpawn<(S,)> for DBStat<Scan<Unselected>>
impl<S, I> ParameterizedSpawn<(S,)> for DBStat<Scan<Unselected>>
Source§fn spawn_with(&mut self, (tables): (S,)) -> Result<Self::Output, Self::Error>
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.
type Output = Child
type Error = Error
Source§impl<S, I> ParameterizedSpawn<(S,)> for DBStat<CheckPoint<Unselected>>
Available on non-crate feature lt2023_1 only.
impl<S, I> ParameterizedSpawn<(S,)> for DBStat<CheckPoint<Unselected>>
lt2023_1 only.Source§fn spawn_with(&mut self, (tables): (S,)) -> Result<Self::Output, Self::Error>
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.