Module: ActiveTracker

Defined in:
lib/active_tracker.rb,
lib/active_tracker/model.rb,
lib/active_tracker/engine.rb,
lib/active_tracker/plugin.rb,
lib/active_tracker/router.rb,
lib/active_tracker/version.rb,
lib/active_tracker/plugin/base.rb,
lib/active_tracker/plugin/query.rb,
lib/active_tracker/rails_logger.rb,
lib/active_tracker/configuration.rb,
lib/active_tracker/plugin/request.rb,
lib/active_tracker/output_capturer.rb,
lib/active_tracker/plugin/exception.rb,
lib/active_tracker/exception_capturer.rb,
app/jobs/active_tracker/application_job.rb,
app/helpers/active_tracker/images_helper.rb,
app/helpers/active_tracker/output_helper.rb,
app/helpers/active_tracker/pagination_helper.rb,
app/models/active_tracker/application_record.rb,
app/helpers/active_tracker/application_helper.rb,
app/controllers/active_tracker/base_controller.rb,
app/controllers/active_tracker/queries_controller.rb,
app/controllers/active_tracker/requests_controller.rb,
app/controllers/active_tracker/dashboard_controller.rb,
app/controllers/active_tracker/exceptions_controller.rb

Defined Under Namespace

Modules: ApplicationHelper, ImagesHelper, OutputHelper, PaginationHelper, Plugin Classes: ApplicationJob, ApplicationRecord, BaseController, Configuration, DashboardController, Engine, Error, ExceptionCapturer, ExceptionsController, Model, OutputCapturer, QueriesController, RailsLogger, RequestsController, Router

Constant Summary collapse

VERSION =
"0.4.9"

Class Method Summary collapse

Class Method Details

.connectionObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/active_tracker.rb', line 11

def self.connection
  if @redis
    begin
      @redis.ping
    rescue
      @redis = nil
    end
  end

  @redis ||= Redis.new(url: ActiveTracker::Configuration.redis_url)

  begin
    @redis.ping
  rescue
    @redis = nil
  end

  @redis
rescue Errno::ECONNREFUSED, Redis::CannotConnectError
  @redis = nil
end

.connection_offline?Boolean

Returns:

  • (Boolean)


33
34
35
36
37
# File 'lib/active_tracker.rb', line 33

def self.connection_offline?
  offline = connection.nil?
  Rails.logger.error("ActiveTracker: Redis is offline/unreachable") if offline
  offline
end

.reset_connectionObject



7
8
9
# File 'lib/active_tracker.rb', line 7

def self.reset_connection
  @redis = nil
end