Class: SourceMonitor::Dashboard::Queries::StatsQuery
- Inherits:
-
Object
- Object
- SourceMonitor::Dashboard::Queries::StatsQuery
- Defined in:
- lib/source_monitor/dashboard/queries/stats_query.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(reference_time:) ⇒ StatsQuery
constructor
A new instance of StatsQuery.
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
#call ⇒ Object
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 |