MetricsCollector is a gem for Ruby on Rails designed to collect different metrics from projects, it provides commands to collect metrics from cloc, brakeman, rubycritic and simplecov.
Install the gem and add to the application's Gemfile by executing:
$ bundle add metrics_collector
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install metrics_collector
- Ruby 2.4+
Command Line Flag | Description |
---|---|
-l /--libraries |
Specify which libraries you specifically want to run to collect metrics |
-o /--outputs |
Write output to a specific file formats (see Supported libraries/outputs) |
-sl /--slack |
Send metrics to slack channel (see Slack) |
-sp /--spreadsheet |
Send metrics to google spreadsheet document (see Spreadsheets) |
-h /--help |
Show command line flag documentation |
-v /--version |
Show version |
-
bundle exec metrics_collector
-
Pass libraries as a first arguments
bundle exec metrics_collector -l cloc,rubycritic
-
To get this metrics only in json/csv/console type
bundle exec metrics_collector -o console,csv
Supported libraries
Supported output formats
- CSV
- JSON
- Slack channel(s)
- Google Spreadsheets
- Console
Send outputs to slack channel(s)
bundle exec metrics_collector --slack xoxp-slack-user-oath-token,CHANNELID2,CHANNELID8
Send outputs to google spreadsheet document
Pass spreadsheet id and service account's details as an arguments
bundle exec metrics_collector --spreadsheet spredsheet_id,credentials_path
You can also configure client secret in .metrics_collector.yml
google_spreadsheet:
spreadsheet_id: spreadsheet_id
client_secret:
type: ''
project_id: ''
private_key_id: ''
...
If you're interested in seeing the changes between each version
of metrics_collector
, read the MetricsCollector Changelog.
Everyone interacting in the MetricsCollector project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
The gem is available as open source under the terms of the MIT License.
Check out our article about the process of creation of MetricsCollector.