Module: Sentiero

Defined in:
lib/sentiero.rb,
lib/sentiero/store.rb,
lib/sentiero/erasure.rb,
lib/sentiero/version.rb,
lib/sentiero/reporter.rb,
lib/sentiero/redaction.rb,
lib/sentiero/user_agent.rb,
lib/sentiero/window_ref.rb,
lib/sentiero/fingerprint.rb,
lib/sentiero/stores/file.rb,
lib/sentiero/store/limits.rb,
lib/sentiero/stores/redis.rb,
lib/sentiero/web/base_app.rb,
lib/sentiero/web/escaping.rb,
lib/sentiero/web/manifest.rb,
lib/sentiero/configuration.rb,
lib/sentiero/ip_anonymizer.rb,
lib/sentiero/stores/memory.rb,
lib/sentiero/stores/sqlite.rb,
lib/sentiero/web/track_app.rb,
lib/sentiero/web/assets_app.rb,
lib/sentiero/web/basic_auth.rb,
lib/sentiero/web/csv_writer.rb,
lib/sentiero/web/errors_app.rb,
lib/sentiero/web/events_app.rb,
lib/sentiero/web/formatting.rb,
lib/sentiero/web/ingest_app.rb,
lib/sentiero/web/script_tag.rb,
lib/sentiero/analytics/stats.rb,
lib/sentiero/web/body_reader.rb,
lib/sentiero/analytics/events.rb,
lib/sentiero/redaction/config.rb,
lib/sentiero/reporter/context.rb,
lib/sentiero/stores/redis/lua.rb,
lib/sentiero/analytics/bounded.rb,
lib/sentiero/reporter/scrubber.rb,
lib/sentiero/store/error_store.rb,
lib/sentiero/stores/redis/keys.rb,
lib/sentiero/web/analytics_app.rb,
lib/sentiero/web/dashboard_app.rb,
lib/sentiero/analytics/analyzer.rb,
lib/sentiero/analytics/exporter.rb,
lib/sentiero/web/monitoring_app.rb,
lib/sentiero/analytics/segmenter.rb,
lib/sentiero/reporter/dispatcher.rb,
lib/sentiero/reporter/middleware.rb,
lib/sentiero/reporter/normalizer.rb,
lib/sentiero/store/session_store.rb,
lib/sentiero/web/views/base_view.rb,
lib/sentiero/reporter/test_helper.rb,
lib/sentiero/stores/sqlite/schema.rb,
lib/sentiero/web/basic_auth_check.rb,
lib/sentiero/web/shareable_replay.rb,
lib/sentiero/web/views/forms_view.rb,
lib/sentiero/web/views/export_view.rb,
lib/sentiero/web/views/funnel_view.rb,
lib/sentiero/web/views/import_view.rb,
lib/sentiero/web/views/scroll_view.rb,
lib/sentiero/web/views/vitals_view.rb,
lib/sentiero/reporter/configuration.rb,
lib/sentiero/reporter/log_transport.rb,
lib/sentiero/web/views/heatmap_view.rb,
lib/sentiero/analytics/form_analyzer.rb,
lib/sentiero/reporter/http_transport.rb,
lib/sentiero/reporter/null_transport.rb,
lib/sentiero/reporter/report_context.rb,
lib/sentiero/reporter/test_transport.rb,
lib/sentiero/web/views/analyzer_view.rb,
lib/sentiero/web/views/segments_view.rb,
lib/sentiero/analytics/problem_detail.rb,
lib/sentiero/analytics/error_discovery.rb,
lib/sentiero/analytics/funnel_analyzer.rb,
lib/sentiero/web/views/engagement_view.rb,
lib/sentiero/web/views/event_show_view.rb,
lib/sentiero/analytics/heatmap_analyzer.rb,
lib/sentiero/analytics/stats_aggregator.rb,
lib/sentiero/web/views/conversions_view.rb,
lib/sentiero/web/views/frustration_view.rb,
lib/sentiero/web/views/page_report_view.rb,
lib/sentiero/analytics/entry_attribution.rb,
lib/sentiero/web/views/errors_index_view.rb,
lib/sentiero/web/views/events_index_view.rb,
lib/sentiero/web/views/problem_show_view.rb,
lib/sentiero/web/views/session_show_view.rb,
lib/sentiero/analytics/conversion_analyzer.rb,
lib/sentiero/analytics/engagement_analyzer.rb,
lib/sentiero/analytics/web_vitals_analyzer.rb,
lib/sentiero/web/views/sessions_index_view.rb,
lib/sentiero/analytics/frustration_analyzer.rb,
lib/sentiero/analytics/page_report_analyzer.rb,
lib/sentiero/analytics/server_event_metrics.rb,
lib/sentiero/web/views/analytics_index_view.rb,
lib/sentiero/analytics/frustration/detectors.rb,
lib/sentiero/analytics/scroll_depth_analyzer.rb,
lib/sentiero/web/views/client_error_show_view.rb,
lib/sentiero/analytics/browser_event_discovery.rb,
lib/sentiero/analytics/collectors/form_collector.rb,
lib/sentiero/analytics/collectors/click_collector.rb,
lib/sentiero/analytics/collectors/error_collector.rb,
lib/sentiero/analytics/collectors/scroll_collector.rb,
lib/sentiero/analytics/collectors/vitals_collector.rb,
lib/sentiero/analytics/collectors/custom_tag_collector.rb,
lib/sentiero/analytics/stats_aggregator/result_builder.rb,
lib/sentiero/analytics/collectors/frustration_collector.rb

Defined Under Namespace

Modules: Analytics, Erasure, Fingerprint, IpAnonymizer, Redaction, Reporter, Stores, UserAgent, Web Classes: Configuration, Error, Store, WindowRef

Constant Summary collapse

VERSION =
"1.0.0.alpha1"

Class Method Summary collapse

Class Method Details

.configurationObject



29
30
31
# File 'lib/sentiero.rb', line 29

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



33
34
35
# File 'lib/sentiero.rb', line 33

def configure
  yield(configuration)
end

.erase_sessions(ids) ⇒ Object



61
62
63
# File 'lib/sentiero.rb', line 61

def erase_sessions(ids)
  Erasure.erase_sessions(store, ids)
end

.erase_where(since: nil, until_time: nil) ⇒ Object



65
66
67
# File 'lib/sentiero.rb', line 65

def erase_where(since: nil, until_time: nil)
  Erasure.erase_where(store, since: since, until_time: until_time)
end

.purge_expired!Object



54
55
56
57
58
59
# File 'lib/sentiero.rb', line 54

def purge_expired!
  period = configuration.retention_period
  return unless period

  store.purge_older_than(period)
end

.reset_all_configuration!Object

Resets the core config plus the Rails and Reporter configs when those subsystems are loaded — one teardown for tests instead of three.



43
44
45
46
47
48
# File 'lib/sentiero.rb', line 43

def reset_all_configuration!
  reset_configuration!
  Sentiero::Rails.reset_configuration! if defined?(Sentiero::Rails) && Sentiero::Rails.respond_to?(:reset_configuration!)
  Sentiero::Reporter.reset! if defined?(Sentiero::Reporter) && Sentiero::Reporter.respond_to?(:reset!)
  configuration
end

.reset_configuration!Object



37
38
39
# File 'lib/sentiero.rb', line 37

def reset_configuration!
  @configuration = Configuration.new
end

.storeObject



50
51
52
# File 'lib/sentiero.rb', line 50

def store
  configuration.store || raise(Error, "No store configured.")
end