Class: SourceMonitor::Analytics::SourceFetchIntervalDistribution

Inherits:
Object
  • Object
show all
Defined in:
lib/source_monitor/analytics/source_fetch_interval_distribution.rb

Defined Under Namespace

Classes: Bucket

Constant Summary collapse

BUCKETS =
[
  { label: "5-30 min", min: 5, max: 30 },
  { label: "30-60 min", min: 30, max: 60 },
  { label: "60-120 min", min: 60, max: 120 },
  { label: "120-240 min", min: 120, max: 240 },
  { label: "240-480 min", min: 240, max: 480 },
  { label: "480+ min", min: 480, max: nil }
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(scope: SourceMonitor::Source.all) ⇒ SourceFetchIntervalDistribution

Returns a new instance of SourceFetchIntervalDistribution.



17
18
19
# File 'lib/source_monitor/analytics/source_fetch_interval_distribution.rb', line 17

def initialize(scope: SourceMonitor::Source.all)
  @scope = scope
end

Instance Method Details

#bucketsObject



21
22
23
# File 'lib/source_monitor/analytics/source_fetch_interval_distribution.rb', line 21

def buckets
  @buckets ||= build_buckets
end