Class: Ask::Monitoring::Metrics::Throughput

Inherits:
Base
  • Object
show all
Defined in:
lib/ask/monitoring/metrics/throughput.rb

Overview

Computes throughput (requests per minute) chart data.

Instance Attribute Summary

Attributes inherited from Base

#scope

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Ask::Monitoring::Metrics::Base

Instance Method Details

#as_chart_dataObject



6
7
8
9
10
11
# File 'lib/ask/monitoring/metrics/throughput.rb', line 6

def as_chart_data
  scope
    .group_by_period(:hour, :created_at)
    .count
    .map { |date, value| { date: date, value: value } }
end