Learn R Programming

drake (version 4.2.0)

predict_runtime: Function predict_runtime

Description

Predict the elapsed runtime of the next call to `make()`. This function simply sums the elapsed build times. from rate_limiting_times().

Usage

predict_runtime(plan, from_scratch = FALSE, targets_only = FALSE,
  targets = drake::possible_targets(plan), envir = parent.frame(),
  verbose = TRUE, cache = NULL,
  parallelism = drake::default_parallelism(), jobs = 1,
  future_jobs = jobs, packages = (.packages()), prework = character(0),
  config = NULL, digits = 0, path = getwd(), search = TRUE)

Arguments

plan

same as for make

from_scratch

logical, whether to predict a make() build from scratch or to take into account the fact that some targets may be already up to date and therefore skipped.

targets_only

logical, whether to factor in just the targets into the calculations or use the build times for everything, including the imports

targets

Targets to build in the workflow. Timing information is limited to these targets and their dependencies.

envir

same as for make

verbose

same as for make

cache

optional drake cache. See codenew_cache(). The cache argument is ignored if a non-null config argument is supplied.

parallelism

samea as for make. Used to parallelize import objects.

jobs

same as for make, just used to process imports

future_jobs

hypothetical number of jobs assumed for the predicted runtime. assuming this number of jobs.

packages

same as for make

prework

same as for make

config

option internal runtime parameter list of make(...), produced with config(). Computing this in advance could save time if you plan multiple calls to this function.

digits

number of digits for rounding the times.

path

file path to the folder contianing the cache. Yes, this is the parent directory containing the cache, not the cache itself.

search

logical, whether to search back in the file system for the cache.

Details

For the results to make sense, the previous build times of all targets need to be available (automatically cached by make()). Otherwise, predict_runtime() will warn you and tell you which targets have missing times.

See Also

rate_limiting_times, build_times make

Examples

Run this code
# NOT RUN {
load_basic_example()
make(my_plan)
predict_runtime(my_plan, digits = 4) # everything is up to date
predict_runtime(my_plan, digits = 4, from_scratch = TRUE) # 1 job
predict_runtime(my_plan, future_jobs = 2, digits = 4, from_scratch = TRUE)
predict_runtime(
  my_plan,
  targets = c("small", "large"),
  future_jobs = 2,
  digits = 4,
  from_scratch = TRUE
)
# }

Run the code above in your browser using DataLab