dev-master
9999999-devExperimental module which provides metrics on SilverStripe modules in use
BSD-3-Clause
The Requires
cms silverstripe module metrics
Experimental module which provides metrics on SilverStripe modules in use
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., (*1)
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., (*2)
/tmp/ss-module-metrics
directorygit clone https://github.com/fspringveldt/silverstripe-module-metrics /tmp/ss-module-metrics
input.txt
, with the following content:$HOME/www/ss-site-1 $HOME/www/ss-site-2
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., (*3)
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" } ]
, (*4)
See License, (*5)
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., (*6)
Feel free to alter the license.md to suit if you wan tto use an alternative license. You can use choosealicense.com to help pick a suitable license for your project., (*7)
Bugs are tracked in the issues section of this repository. Before submitting an issue please read over existing issues to ensure yours is unique., (*8)
If the issue does look like a new bug:, (*9)
Please report security issues to the module maintainers directly. Please don't file security issues in the bugtracker., (*10)
If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers., (*11)
Experimental module which provides metrics on SilverStripe modules in use
BSD-3-Clause
cms silverstripe module metrics