<commit_before>---
title: "Pre-commit Slowness Triage Guide"
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Pre-commit Slowness Triage Guide

Beam pre-commit jobs are suites of tests run automatically on Jenkins build
machines for each pull request (PR) submitted to
[apache/beam](https://github.com/apache/beam). For more information and the
difference between pre-commits and post-commits, see
[testing](https://cwiki.apache.org/confluence/display/BEAM/Contribution+Testing+Guide).

## What are fast pre-commits?

Pre-commit tests are required to pass before a pull request (PR) is merged.
When these tests are slow they slow down Beam's development process.
The aim is to have 95% of pre-commit jobs complete within 30 minutes
(failing or passing).

Technically, the 95th percentile of running time should be below 30 minutes over
the past 4 weeks, where running time is the duration of time the job spends in
the Jenkins queue + the actual time it spends running.

## Determining Slowness

There are two main signs of slowness:

1. Pre-commit jobs are timing out after 30 minutes. This can be determined from
   the console log of a job.
1. Pre-commits aren't timing out, but the total wait time for pre-commit results
   is >30m.

### Pre-commit Dashboard

The Beam Community Metrics site contains a [Pre-Commit
Tests](http://192.168.3.11/d/_TNndF2iz/pre-commit-tests) dashboard showing
job timing trends. You can modify the time window (defaults to 7 days) or filter
down to a specific test suite by clicking on it.

![example pre-commit duration dashboard](/images/precommit_dashboard.png)<commit_msg>[BEAM-6458] Link to metrics page by domain, not ip address<commit_after>---
title: "Pre-commit Slowness Triage Guide"
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Pre-commit Slowness Triage Guide

Beam pre-commit jobs are suites of tests run automatically on Jenkins build
machines for each pull request (PR) submitted to
[apache/beam](https://github.com/apache/beam). For more information and the
difference between pre-commits and post-commits, see
[testing](https://cwiki.apache.org/confluence/display/BEAM/Contribution+Testing+Guide).

## What are fast pre-commits?

Pre-commit tests are required to pass before a pull request (PR) is merged.
When these tests are slow they slow down Beam's development process.
The aim is to have 95% of pre-commit jobs complete within 30 minutes
(failing or passing).

Technically, the 95th percentile of running time should be below 30 minutes over
the past 4 weeks, where running time is the duration of time the job spends in
the Jenkins queue + the actual time it spends running.

## Determining Slowness

There are two main signs of slowness:

1. Pre-commit jobs are timing out after 30 minutes. This can be determined from
   the console log of a job.
1. Pre-commits aren't timing out, but the total wait time for pre-commit results
   is >30m.

### Pre-commit Dashboard

The Beam Community Metrics site contains a [Pre-Commit
Tests](http://metrics.beam.apache.org/d/_TNndF2iz/pre-commit-tests) dashboard showing
job timing trends. You can modify the time window (defaults to 7 days) or filter
down to a specific test suite by clicking on it.

![example pre-commit duration dashboard](/images/precommit_dashboard.png)
{'fraction_non_alphanumeric': 0.06964705882352941, 'fraction_numerical': 0.012941176470588235, 'mean_word_length': 4.360655737704918, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4153527', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1122, 'n_words': 586}