% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_metrics.R
\name{plot_directory}
\alias{plot_directory}
\title{Plot metrics across versions for all files in a given directory.}
\usage{
plot_directory(test_directory, metric = "testMetrics", num_commits = 5,
  save_data = FALSE, save_plots = TRUE)
}
\arguments{
\item{test_directory}{Directory containing the test-files which are to be used.}

\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 files are to
be tested, with default being 5.}

\item{save_data}{If set to TRUE, the metrics data is saved in a folder 'Rperform_Data'
in the current directory.}

\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.}
}
\description{
Given a directory path, plot the memory and time usage statistics of all files
in the directory against the commit message summaries of the specified number
of commits in the current git repository.
}
\section{WARNING}{

  Library assumes the current directory to be the root directory of the
  package being tested.
}
\examples{

\dontrun{
# Set to the git repository in consideration.
setwd("path/to/repo")
d_path <- "path/to/tests"

# Load the library
library(Rperform)

## Example-1

# Pass the parameters and obtain the run-time followed by memory details against 10 commits.
plot_directory(test_directory = d_path, metric = "time", num_commits = 10,
               save_data = F, save_plots = T)
plot_directory(test_directory = d_path, metric = "memory", num_commits = 10,
               save_data = F, save_plots = T)

## Example-2

# Obtain both memory and time metrics for each individual testthat block
# inside a file and the file itself ,and save the resulting plot as well as
# data.
plot_directory(d_path, metric = "testMetrics", num_commits = 5, save_data = F,
               save_plots = T)
}

}

