class Sidekiq::Statistic::Charts

Public Instance Methods

dates() click to toggle source
# File lib/sidekiq/statistic/statistic/charts.rb, line 17
def dates
  @dates ||= statistic_hash.flat_map(&:keys)
end
information_for(type) click to toggle source
# File lib/sidekiq/statistic/statistic/charts.rb, line 6
def information_for(type)
  worker_names.reverse.map.with_index do |worker, i|
    color_hex = Helpers::Color.for(worker, :hex)
    index = "data#{i}"
    dataset = [index] + statistic_for(worker).map { |val| val.fetch(type, 0) }
    { worker: worker,
      dataset: dataset,
      color: color_hex }
  end
end