PHPackages                             fspringveldt/silverstripe-module-metrics - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. fspringveldt/silverstripe-module-metrics

ActiveSilverstripe-module[Utility &amp; Helpers](/categories/utility)

fspringveldt/silverstripe-module-metrics
========================================

Experimental module which provides metrics on SilverStripe modules in use

081PHP

Since Nov 10Pushed 8y ago1 watchersCompare

[ Source](https://github.com/fspringveldt/silverstripe-module-metrics)[ Packagist](https://packagist.org/packages/fspringveldt/silverstripe-module-metrics)[ RSS](/packages/fspringveldt-silverstripe-module-metrics/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

SilverStripe module-usage inspector
===================================

[](#silverstripe-module-usage-inspector)

This module aims to supply dev-ops teams with information related to SilverStripe module usage across many sites. It does this by analysing a modules DataObjects and DataExtension classes.

1. DataObjects: if at least one of them has rows, it assumes the module is in use
2. DataExtensions: if any new columns are introduced by these with non-null values, it assumes the module is in use.

NB: `DataExtension::augmentDataBase()` also mutates the database (see Versioned or Translatable), but there is no structured way to determine what those mutations are. For these modules some analysis at a module-level is required to determine which table's existence can reliably determine the module's usage.

Requirements
------------

[](#requirements)

- SilverStripe ^3.1

Installation and setup
----------------------

[](#installation-and-setup)

1. Clone down the repository to your `/tmp/ss-module-metrics` directory

```
git clone https://github.com/fspringveldt/silverstripe-module-metrics /tmp/ss-module-metrics

```

2. Create an simple text file in the same directory you cloned this project to (i.e. /tmp/ss-module-metrics), into which you put paths to all the SilverStripe directories you would like to include in your scan. An example below of a file called `input.txt`, with the following content:

```
$HOME/www/ss-site-1
$HOME/www/ss-site-2
```

3. Run the following from your bash command prompt to output its results:

```
cd /tmp/ss-module-metrics/ && >output.txt && awk '{printf "php cli-module-metrics.php %s >> output.txt\n", $0}' input.txt | sh
```

***N.B.** By including the manifest-like SilverStripe files (Core.php) from your script you introduce a possibility of having cache files re-generated, which could cause problems for these websites to frontend users. Care must therefore be taken to ensure that the script is run as the web server's user.*

4. This command runs the module-usage inspector on all the sites specified in `input.txt`, sends the output in JSON format to a file called `/tmp/ss-module-metrics/output.txt`. The below fields are output per site, per module. This file can be imported to MySQL for further analysis.

```
[
  {
      "Site": "http:\/\/dev.ss3.local",
      "ModuleName": "userforms",
      "InUse": 1,
      "UsageType": "DataObject",
      "RecordsFound": 2,
      "FieldInUse": null,
      "TableInUse": "EditableCheckbox",
      "LastEdited": "2017-08-01 23:24:32"
  }
]
```

#### Field descriptions

[](#field-descriptions)

- **Site**: The output of Director::baseURL()
- **ModuleName**: The actual module
- **InUse**: Either 0, 1 or 2. A value of 2 indicates the module has no Database interaction
- **UsageType**: Can be one of either
    - Extension - an extension column introduced by this module has valid data (i.e. not null and &lt;&gt; 0)
    - DataObject - a dataobject introduced byt this module has data
    - AugmentDatabase - rows were found in a table introduced through DataExtension::augmentDatabase()
    - NoDBInteraction - no database interaction was found within this module
- **RecordsFound**: The number of records found in the case of a DataObject
- **FieldInUse**: The first DataExtension field found with a non-null value.
- **TableInUse**: The first database table found with a row
- **LastEdited**: The LastEdited column in the table

#### Sample results formatted as table

[](#sample-results-formatted-as-table)

[![Sample formatted output](docs/images/sample-formatted-output.png)](docs/images/sample-formatted-output.png)

License
-------

[](#license)

See [License](license.md)

We have included a 3-clause BSD license you can use as a default. We advocate for the BSD license as it is one of the most permissive and open licenses.

Feel free to alter the [license.md](license.md) to suit if you wan tto use an alternative license. You can use [choosealicense.com](http://choosealicense.com) to help pick a suitable license for your project.

Maintainers
-----------

[](#maintainers)

- Franco Springveldt

Bugtracker
----------

[](#bugtracker)

Bugs are tracked in the issues section of this repository. Before submitting an issue please read over existing issues to ensure yours is unique.

If the issue does look like a new bug:

- Create a new issue
- Describe the steps required to reproduce your issue, and the expected outcome. Unit tests, screenshots and screencasts can help here.
- Describe your environment as detailed as possible: SilverStripe version, Browser, PHP version, Operating System, any installed SilverStripe modules.

Please report security issues to the module maintainers directly. Please don't file security issues in the bugtracker.

Development and contribution
----------------------------

[](#development-and-contribution)

If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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/9717cc5aaeaf534cbead15e8a28f3e74d14e12c708b1a633c7502c433b2ad397?d=identicon)[fspringveldt](/maintainers/fspringveldt)

---

Top Contributors

[![andrewandante](https://avatars.githubusercontent.com/u/9702648?v=4)](https://github.com/andrewandante "andrewandante (1 commits)")[![fspringveldt](https://avatars.githubusercontent.com/u/10938392?v=4)](https://github.com/fspringveldt "fspringveldt (1 commits)")

### Embed Badge

![Health badge](/badges/fspringveldt-silverstripe-module-metrics/health.svg)

```
[![Health](https://phpackages.com/badges/fspringveldt-silverstripe-module-metrics/health.svg)](https://phpackages.com/packages/fspringveldt-silverstripe-module-metrics)
```

###  Alternatives

[react/event-loop

ReactPHP's core reactor event loop that libraries can use for evented I/O.

1.3k139.6M664](/packages/react-event-loop)[safran-cassiopee/php-taf-decoder

TAF weather forecast decoder

1211.2k](/packages/safran-cassiopee-php-taf-decoder)[yahnis-elsts/ajax-wrapper

AJAX action wrapper for WordPress

213.3k](/packages/yahnis-elsts-ajax-wrapper)

PHPackages © 2026

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