gitlab-org--gitlab-foss/doc/ci/metrics_reports.md
Marcel Amirault 73c6477b7e Changing badges to use parentheses not brackets
Previously, we used brackets to denote the tier badges,
but this made Kramdown, the docs site Markdown renderer,
show many warnings when building the site. This is now
fixed by using parentheses instead of square brackets.

This was caused by [PREMIUM] looking like a link to
Kramdown, which couldn't find a URL there.

See:
- https://gitlab.com/gitlab-com/gitlab-docs/merge_requests/484
- https://gitlab.com/gitlab-org/gitlab-ce/issues/63800
2019-07-08 08:50:38 +00:00

1.7 KiB

type
reference

Metrics Reports (PREMIUM)

Introduced in GitLab Premium 11.10. Requires GitLab Runner 11.10 and above.

Overview

GitLab provides a lot of great reporting tools for merge requests - JUnit reports, codequality, performance tests, etc. While JUnit is a great open framework for tests that "pass" or "fail", it is also important to see other types of metrics from a given change.

You can configure your job to use custom Metrics Reports, and GitLab will display a report on the merge request so that it's easier and faster to identify changes without having to check the entire log.

Metrics Reports

Use cases

Consider the following examples of data that can utilize Metrics Reports:

  1. Memory usage
  2. Load testing results
  3. Code complexity
  4. Code coverage stats

How it works

Metrics are read from the metrics report (default: metrics.txt). They are parsed and displayed in the MR widget.

All values are considered strings and string compare is used to find differences between the latest available metrics artifact from:

  • master
  • The feature branch

How to set it up

Add a job that creates a metrics report (default filename: metrics.txt). The file should conform to the OpenMetrics format.

For example:

metrics:
  script:
    - echo 'metric_name metric_value' > metrics.txt
  artifacts:
    reports:
      metrics: metrics.txt