compare_dir: Compare performance across directories/repositories.

View source: R/travisPR_metrics.R

compare_dirR Documentation

Compare performance across directories/repositories.

Description

Given a test-file, two directories and the required metric, returns the metric details of the file against the first commit till the latest common commit for dir1, and against the latest commit for dir2. It also returns information regarding the latest common commit for the two directories.

Usage

compare_dir(dir1, dir2, test_path, metric = "time", PR = F)

Arguments

dir1

Path to the first directory/repository.

dir2

Path to the second directory/repository.

test_path

File-path, relative to the directories, for the test file to be tested.

metric

The metric (runtime or memory) for which the file is to be tested.

PR

When set to True, it performs the analysis in accordance with the setup on Travis-CI environment for testing Pull Requests.

Value

compare_brancht returns an object of class "list" containing two members.

The first member is a data-frame and consists of the following columns: test_name metric_name status metric_val message sha date_time directory

The second member is a data-frame and consists of the following columns: common_datetime common_message cnum_b1 cnum_b2

Warning

Function assumes the current directory to be the parent directory of both the repositories being tested. That means both the repositories should be inside the same directory.

Examples


## Not run: 
# Set the current directory to the parent directory of the concerned repositories.
setwd("./Path/to/parent/directory")

# Set the directory paths
d_path1 <- "Path/to/first/directory"
d_path2 <- "Path/to/second/directory"

# Set the file-path
t_path <- "Path/to/file"

# Load the library and pass the parameters to the function
library(Rperform)
compare_dir(d_path1, d_path2, t_path, metric = "time")

## End(Not run)


analyticalmonk/Rperform documentation built on July 3, 2022, 2:36 a.m.