-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathplot_metrics.Rd
72 lines (57 loc) · 2.47 KB
/
plot_metrics.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_metrics.R
\name{plot_metrics}
\alias{plot_metrics}
\title{Plot test-file metrics across versions.}
\usage{
plot_metrics(test_path, metric, num_commits = 5, save_data = FALSE,
save_plots = FALSE, interactive = FALSE)
}
\arguments{
\item{test_path}{File-path of the test-file which is to be used for run-time
comparisons.}
\item{metric}{Type of plot(s) desired. This can be set to \code{time},
\code{memory}, \code{memtime} or \code{testMetrics}. (See examples below
for more details)}
\item{num_commits}{Number of commits (versions) against which the file is to
be tested, with default being 5.}
\item{save_data}{If set to TRUE, the data frame containing the metrics
information is stored in the 'Rperform_Data' directory in the root of the
repo. (default set to FALSE)}
\item{save_plots}{If set to TRUE, the plots generated are stored in the
'Rperform_plots' directory in the root of the repo rather than being
printed. (default set to TRUE)}
\item{interactive}{If set to TRUE, the plots generated are interactive. The
resulting plot is rendered in the default browser.}
}
\description{
Given a test-file path, plot the metrics of entire file and individual
testthat blocks against the commit message summaries of the specified number
of commits in the current git repository. If the parameter save_data is set
to true, it also stores the corresponding data-frames in an RData file in a
folder 'Rperform_Data' in the current directory.The metrics plotted are in
accordance with those specified using the parameter metric.
}
\section{WARNING}{
Function assumes the current directory to be the root directory of the
repository/package being tested.
}
\examples{
\dontrun{
# Set the current directory to the git repository concerned.
setwd("./Path/to/repository")
# Specify the test-file path
t_path <- "Path/to/file"
# Load the library
library(Rperform)
## Example-1
# Pass the parameters and obtain the run-time followed by memory details against 10 commits
plot_metrics(test_path = t_path, metric = "time", n_commits = 10, save_data = F)
plot_metrics(test_path = t_path, metric = "memory", n_commits = 10, save_data = F)
## Example-2
# Obtain both memory and time metrics for each individual testthat block
# inside a file and the file itself. The plots get stored in a directory
# 'Rperform_testMetrics' in the repo's root directory.
plot_metrics(test_path = t_path, metric = "testMetrics", n_commits = 5, save_data = F)
}
}