Sha256: 4e164af924d436e01503a2198929a72eada5e38b0d1b78bdcea91e998c4cc358

Contents?: true

Size: 803 Bytes

Versions: 15

Compression:

Stored size: 803 Bytes

Contents

MetricFu.reporting_require { 'graphs/grapher' }
module MetricFu
  class StatsGrapher < Grapher
    attr_accessor :loc_counts, :lot_counts, :labels

    def self.metric
      :stats
    end

    def initialize
      super
      self.loc_counts = []
      self.lot_counts = []
      self.labels = {}
    end

    def get_metrics(metrics, date)
      if metrics && metrics[:stats]
        self.loc_counts.push(metrics[:stats][:codeLOC].to_i)
        self.lot_counts.push(metrics[:stats][:testLOC].to_i)
        self.labels.update( { self.labels.size => date })
      end
    end

    def title
      'Stats: LOC & LOT'
    end

    def data
      [
        ['LOC', @loc_counts.join(',')],
        ['LOT', @lot_counts.join(',')],
      ]
    end

    def output_filename
      'stats.js'
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
metric_fu-4.11.3 lib/metric_fu/metrics/stats/grapher.rb
metric_fu-4.11.2 lib/metric_fu/metrics/stats/grapher.rb
metric_fu-4.11.1 lib/metric_fu/metrics/stats/grapher.rb
metric_fu-4.11.0 lib/metric_fu/metrics/stats/grapher.rb
metric_fu-4.10.0 lib/metric_fu/metrics/stats/stats_grapher.rb
metric_fu-4.9.0 lib/metric_fu/metrics/stats/stats_grapher.rb
metric_fu-4.8.0 lib/metric_fu/metrics/stats/stats_grapher.rb
metric_fu-4.7.4 lib/metric_fu/metrics/stats/stats_grapher.rb
metric_fu-4.7.3 lib/metric_fu/metrics/stats/stats_grapher.rb
metric_fu-4.7.2 lib/metric_fu/metrics/stats/stats_grapher.rb
metric_fu-4.7.1 lib/metric_fu/metrics/stats/stats_grapher.rb
metric_fu-4.7.0 lib/metric_fu/metrics/stats/stats_grapher.rb
metric_fu-4.6.0 lib/metric_fu/metrics/stats/stats_grapher.rb
metric_fu-4.5.2 lib/metric_fu/metrics/stats/stats_grapher.rb
metric_fu-4.5.1 lib/metric_fu/metrics/stats/stats_grapher.rb