Skip to content

Anadea/metrics_collector

Repository files navigation

GitHub version

MetricsCollector Logo

MetricsCollector

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.

Installation

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

Requirements

  • Ruby 2.4+

Usage

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
  • Collect all metrics and get output in json, csv and console

    bundle exec metrics_collector
  • Get only certain metrics

    Pass libraries as a first arguments

    bundle exec metrics_collector -l cloc,rubycritic
  • Different output options

    To get this metrics only in json/csv/console type

    bundle exec metrics_collector -o console,csv

Supported libraries/outputs

Supported libraries

Supported output formats

  • CSV
  • JSON
  • Slack channel(s)
  • Google Spreadsheets
  • Console

Slack

Send outputs to slack channel(s)

bundle exec metrics_collector --slack xoxp-slack-user-oath-token,CHANNELID2,CHANNELID8

Spreadsheets

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: ''
    ...

Changelog

If you're interested in seeing the changes between each version of metrics_collector, read the MetricsCollector Changelog.

Code of Conduct

Everyone interacting in the MetricsCollector project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Article

Check out our article about the process of creation of MetricsCollector.