Class: Karafka::Web::Tracking::Reporter

Inherits:
Object
  • Object
show all
Includes:
Core::Helpers::Time
Defined in:
lib/karafka/web/tracking/reporter.rb

Overview

Base reporter from which all the reports should inherit

Direct Known Subclasses

Consumers::Reporter, Producers::Reporter

Instance Method Summary collapse

Instance Method Details

#active?Boolean

Can this reporter report. Since some reporters may report only in part of the processes where Karafka is used (like karafka server) each may implement more complex rules.

The basic is not to report unless we have a producer and this producer is active

Returns:

  • (Boolean)


16
17
18
19
20
21
22
# File 'lib/karafka/web/tracking/reporter.rb', line 16

def active?
  return false unless ::Karafka::Web.producer
  return false unless ::Karafka::Web.producer.status.active?
  return false unless ::Karafka::Web.config.tracking.active

  true
end