Learn R Programming

drake (version 4.2.0)

rate_limiting_times: Function rate_limiting_times

Description

Return a data frame of elapsed build times of the rate-limiting targets of a make() workflow.

Usage

rate_limiting_times(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 assume next hypothetical call to make() is a build from scratch (after clean()).

targets_only

logical, whether to factor in just the targets or use times from 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. Supercedes config$envir.

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

same as for make, and also used to process imported objects/files.

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(). config$envir is ignored. Otherwise, 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

The stage column of the returned data frame is an index that denotes a parallelizable stage. Within each stage during make(), the targets are divided among the available jobs. For rate_limiting_times(), we assume the targets are divided evenly among the jobs and one job gets all the slowest targets. The build times of this hypothetical pessimistic job are returned for each stage.

By default from_scratch is FALSE. That way, rate_limiting_times() takes into account that some targets are already up to date, meaning their elapsed build times will be instant during 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, rate_limiting_times() will warn you and tell you which targets have missing times.

See Also

predict_runtime, build_times make

Examples

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

Run the code above in your browser using DataLab