make()
.R/predict_runtime.R
This function simply sums the elapsed build times
from rate_limiting_times()
, and this
feature is experimental.
To date, the accuracy/precision of the results
has not yet been confirmed by performance studies.
predict_runtime(config = drake::read_drake_config(), targets = NULL, future_jobs = 1, from_scratch = FALSE, targets_only = FALSE, digits = 3)
config | option internal runtime parameter list of
|
---|---|
targets | Character vector, names of targets. Predict the runtime of building these targets plus dependencies. Defaults to all targets. |
future_jobs | hypothetical number of jobs assumed for the predicted runtime. assuming this number of jobs. |
from_scratch | logical, whether to predict a
|
targets_only | logical, whether to factor in just the targets into the calculations or use the build times for everything, including the imports |
digits | number of digits for rounding the time |
A lubridate
Duration
object
with the predicted runtime of the next make()
.
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.
rate_limiting_times()
,
build_times()
make()
# NOT RUN { test_with_dir("Quarantine side effects.", { load_basic_example() # Get the code with drake_example("basic"). config <- make(my_plan) # Run the project, build the targets. predict_runtime(config, digits = 4) # Everything is up to date. predict_runtime(config, digits = 4, from_scratch = TRUE) # 1 job # Assumes you clean() out your project and start from scratch with 2 jobs. predict_runtime(config, future_jobs = 2, digits = 4, from_scratch = TRUE) # Predict the runtime of just building targets # "small" and "large". predict_runtime( config, targets = c("small", "large"), from_scratch = TRUE, digits = 4 ) }) # }