Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

measure.sh and measure-file.sh description inside metrics/README.md #343

Merged
merged 7 commits into from
May 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion metrics/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# How Metrics Work
# Metrics

## How Metrics Work

Every executable file in this directory is a calculator of a few
metrics. They all are expected to be executed like this:
Expand All @@ -25,3 +27,35 @@ the name of the metric. The second one contains the value (float or integer).
The third one contains the description of the metric (in general, NOT
for this particular file). A space is mandatory between the first and the
second column, and between the second and the third columns.

## Metrics Calculation

Metrics calculation can be elegantly managed during the measure step outlined
in the `Makefile`. This process initiates with the execution of `steps/measure.sh`,
which performs several preparatory tasks:

1. Creating the necessary files and directories.
2. Collecting jobs to execute in parallel,
with one job designated for each Java file to analyze metrics.
3. Running the jobs using `help/parallel.sh`.

For each job, `steps/measure-file.sh` is executed,
resulting in the following organized file structure:

```text
dataset/
measurements/
yegor256/
cactoos/
Main.java.m
Main.java.m.LOC
Main.java.m.CC
Main.java.m.CoCo
...
```

In this structure, `{file_name}.m` serves as a buffer
for intermediate results during calculations.
The files named `{file_name}.m.{metric_name}` store the calculated metrics,
where `{metric_name}` corresponds to the specific metric
for the file `{file_name}`.
Loading