Sha256: a2f35e51bb6718f22140a1ea27d554b6650d2255d15e30a4820937c044c4c604

Contents?: true

Size: 911 Bytes

Versions: 11

Compression:

Stored size: 911 Bytes

Contents

# frozen_string_literal: true

module Karafka
  module Web
    module Ui
      module Controllers
        # Main Karafka Pro Web-Ui dashboard controller
        class Dashboard < Ui::Controllers::Base
          # View with statistics dashboard details
          def index
            @current_state = Models::ConsumersState.current!
            @counters = Models::Counters.new(@current_state)

            current_metrics = Models::ConsumersMetrics.current!

            # Build the charts data using the aggregated metrics
            @aggregated = Models::Metrics::Aggregated.new(
              current_metrics.to_h.fetch(:aggregated)
            )

            # Load only historicals for the selected range
            @aggregated_charts = Models::Metrics::Charts::Aggregated.new(
              @aggregated, :seconds
            )

            respond
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
karafka-web-0.7.10 lib/karafka/web/ui/controllers/dashboard.rb
karafka-web-0.7.9 lib/karafka/web/ui/controllers/dashboard.rb
karafka-web-0.7.8 lib/karafka/web/ui/controllers/dashboard.rb
karafka-web-0.7.7 lib/karafka/web/ui/controllers/dashboard.rb
karafka-web-0.7.6 lib/karafka/web/ui/controllers/dashboard.rb
karafka-web-0.7.5 lib/karafka/web/ui/controllers/dashboard.rb
karafka-web-0.7.4 lib/karafka/web/ui/controllers/dashboard.rb
karafka-web-0.7.3 lib/karafka/web/ui/controllers/dashboard.rb
karafka-web-0.7.2 lib/karafka/web/ui/controllers/dashboard.rb
karafka-web-0.7.1 lib/karafka/web/ui/controllers/dashboard.rb
karafka-web-0.7.0 lib/karafka/web/ui/controllers/dashboard.rb