Class: SourceMonitor::Dashboard::Queries::StatsQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/source_monitor/dashboard/queries/stats_query.rb

Instance Method Summary collapse

Constructor Details

#initialize(reference_time:) ⇒ StatsQuery

Returns a new instance of StatsQuery.



7
8
9
# File 'lib/source_monitor/dashboard/queries/stats_query.rb', line 7

def initialize(reference_time:)
  @reference_time = reference_time
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/source_monitor/dashboard/queries/stats_query.rb', line 11

def call
  {
    total_sources: integer_value(source_counts["total_sources"]),
    active_sources: integer_value(source_counts["active_sources"]),
    failed_sources: integer_value(source_counts["failed_sources"]),
    total_items: total_items_count,
    fetches_today: fetches_today_count,
    health_distribution: health_distribution,
    scrape_candidates_count: scrape_candidates_count
  }
end