PHPackages                             shawnveltman/testmetrics - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. shawnveltman/testmetrics

ActiveLibrary

shawnveltman/testmetrics
========================

A few helpers to profile your test suite

0223PHP

Since Jul 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/shawnveltman/testmetrics)[ Packagist](https://packagist.org/packages/shawnveltman/testmetrics)[ RSS](/packages/shawnveltman-testmetrics/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

A few helpers to profile your test suite
========================================

[](#a-few-helpers-to-profile-your-test-suite)

[![Latest Version on Packagist](https://camo.githubusercontent.com/02e8b34a656096bdeaef9a97873a9189414e27c4dd67e82c1eca8863b7ca1424/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736861776e76656c746d616e2f746573746d6574726963732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/shawnveltman/testmetrics)[![GitHub Tests Action Status](https://camo.githubusercontent.com/4bf84eeff6ecf1cef20101b0059d280d76a5ff54802c5c098ad772fedfe5c155/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f736861776e76656c746d616e2f746573746d6574726963732f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/shawnveltman/testmetrics/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/ea99c5601cc6c7b18f03c389e1e33abbd38424e848b231e71e4ff7bc7d792c8e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f736861776e76656c746d616e2f746573746d6574726963732f466978253230504850253230636f64652532307374796c652532306973737565733f6c6162656c3d636f64652532307374796c65)](https://github.com/shawnveltman/testmetrics/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/106e1fe4e0877153f81b7aaa2f0532a534156ce5734bcd31f1810e5ce1176db7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736861776e76656c746d616e2f746573746d6574726963732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/shawnveltman/testmetrics)

An easy way to find slow tests within your application. Since Laravel Parallel Testing allows for JUnit logging, this is simply a JUnit xml parser that grabs simple stats (setup time, average test time after setup) for each test suite, to hilight those that are the slowest.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require shawnveltman/testmetrics
```

After installation, be sure to add the following lines to your phpunit.xml file:

```

```

Finally, be sure to add the junit.xml to your gitignore.

Usage
-----

[](#usage)

Now, after you run your parallel tests, you will have the junit.xml file. Grab the contents of that file as a string, and pass it to the test\_results\_parser method, then print your results. That's it!

```
$testmetrics = new Shawnveltman\Testmetrics();
echo $testmetrics->test_results_parser(contents: $file_contents)->print_results();
```

Alternately, you can pass a filepath instead of string contents.

```
$testmetrics = new \Shawnveltman\Testmetrics\Testmetrics();
$path = base_path('junit.xml');
echo $testmetrics->test_results_parser(path: $path)->print_results();
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Shawn Veltman](https://github.com/shawnveltman)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6dd8d72a34070f86fc3cd5180b2cacbf81d41d69b1016b91da26b5ef409b577c?d=identicon)[shawnveltman](/maintainers/shawnveltman)

---

Top Contributors

[![shawnveltman](https://avatars.githubusercontent.com/u/8326484?v=4)](https://github.com/shawnveltman "shawnveltman (30 commits)")

### Embed Badge

![Health badge](/badges/shawnveltman-testmetrics/health.svg)

```
[![Health](https://phpackages.com/badges/shawnveltman-testmetrics/health.svg)](https://phpackages.com/packages/shawnveltman-testmetrics)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
