ClutterStats is a TeamCity plugin that measures the disk space consumption.
As your build starts, or as it finishes, ClutterStats measures the size of the directory (or directories) you specify, and for each, it
- logs the size into the build log
- stores the size into a build parameter
You can measure multiple directories by adding the build feature multiple times.
Add the "Disk-space metrics (ClutterStats)" build feature to your build configuration. To measure the disk-space of your workspace, set it up as follows:
Much the same can be achieved by writing a simple build step that would measure the directory size in the language of your choice (e.g. bash or Powershell) and set the parameter using a service message. In fact, the plugin uses service messages to achieve this. However, an explicit step clutters your build configuration. Also, it's impossible to measure the disk-space consumption before the build using a build step, since even the first build step takes place only after the sources have been updated.
If the directory does not exist, no parameter is set, and no statistic is published. (As opposed to setting these to 0.)
If you omit the parameter name in the build feature dialog, the size of the directory is only logged and no parameter is set.
To build, test, and package the plugin, run mvn package
from the root directory.
To deploy the plugin, copy clutter-stats.zip
into the TeamCity plugin directory and restart the server. If you've built locally, get the zip file from target/clutter-stats.zip
; otherwise grab the latest released version.
Allow measuring the size of a file (as opposed to a directory).
Allow file masks, or lists of files/directories.