Module: Sqreen::Kit

Defined in:
lib/sqreen/kit.rb,
lib/sqreen/kit/version.rb,
lib/sqreen/kit/loggable.rb,
lib/sqreen/kit/http_client.rb,
lib/sqreen/kit/retry_policy.rb,
lib/sqreen/kit/configuration.rb,
lib/sqreen/kit/signals/actor.rb,
lib/sqreen/kit/signals/point.rb,
lib/sqreen/kit/signals/trace.rb,
lib/sqreen/kit/signals/metric.rb,
lib/sqreen/kit/signals/signal.rb,
lib/sqreen/kit/string_sanitizer.rb,
lib/sqreen/kit/signals/dto_helper.rb,
lib/sqreen/kit/signals/stack_trace.rb,
lib/sqreen/kit/signals/signals_client.rb,
lib/sqreen/kit/signals/batch_collector.rb,
lib/sqreen/kit/signals/signal_attributes.rb,
lib/sqreen/kit/signals/auth_signals_client.rb,
lib/sqreen/kit/signals/context/http_context.rb,
lib/sqreen/kit/http_client/authentication_error.rb,
lib/sqreen/kit/http_client/unexpected_status_error.rb

Defined Under Namespace

Modules: Loggable, Signals, StackTrace, StringSanitizer Classes: Configuration, HttpClient, RetryPolicy

Class Method Summary collapse

Class Method Details

.auth_signals_clientObject



21
22
23
24
25
26
27
28
29
# File 'lib/sqreen/kit.rb', line 21

def auth_signals_client
  @auth_signals_client ||=
    Signals::AuthSignalsClient.new(
      signals_client,
      session_key: Configuration.session_key,
      api_key: Configuration.api_key,
      app_name: Configuration.app_name,
    )
end

.batch_collectorObject



36
37
38
39
40
41
42
43
44
# File 'lib/sqreen/kit.rb', line 36

def batch_collector
  @batch_collector ||=
    Signals::BatchCollector.new(
      auth_signals_client,
      flush_size: Configuration.batch_flush_size,
      max_batch_size: Configuration.batch_max_size,
      max_delay_s: Configuration.batch_max_delay_s,
    )
end

.resetObject



46
47
48
49
50
51
52
# File 'lib/sqreen/kit.rb', line 46

def reset
  @auth_signals_client = nil
  @signals_client = nil
  @batch_collector = nil
  @http_client = nil
  @retry_policy = nil
end

.signals_clientObject



31
32
33
34
# File 'lib/sqreen/kit.rb', line 31

def signals_client
  @signals_client ||=
    Signals::SignalsClient.new(http_client)
end

.versionObject



10
11
12
# File 'lib/sqreen/kit/version.rb', line 10

def version
  @version ||= Gem.loaded_specs['sqreen-kit'].version
end