Sha256: 5518652060126d7c471a58d22f53dba66805289c968a70a7ccf2eeaf743678c4

Contents?: true

Size: 627 Bytes

Versions: 1

Compression:

Stored size: 627 Bytes

Contents

# frozen_string_literal: true

class Async::App::Metrics::ComponentsMetricsCollector
  include Async::App::TimerComponent
  include Async::App::AutoloadComponent

  def on_tick = bus.publish("metrics.updated", metrics)
  def interval = 5
  def run_on_start = true
  def on_error(exception) = warn { exception }

  private

  def metrics
    {
      async_app_components: { value: Async::App.instance.components.count },
      async_app_autoloadable_components: { value: Async::App.instance.autoloadable_components.count },
      async_app_timer_components: { value: Async::App.instance.timer_components.count }
    }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
async-tools-0.2.10 lib/async/app/metrics/components_metrics_collector.rb