Class: Sentiero::Store

Inherits:
Object
  • Object
show all
Includes:
ErrorStore, SessionStore
Defined in:
lib/sentiero/store.rb,
lib/sentiero/store/limits.rb,
lib/sentiero/store/error_store.rb,
lib/sentiero/store/session_store.rb

Overview

Abstract store contract, split across two mixins: SessionStore (session-replay recording) and ErrorStore (error tracking). Concrete backends subclass Store and implement both halves.

Defined Under Namespace

Modules: ErrorStore, SessionStore Classes: Limits

Constant Summary collapse

VALID_ID =
/\A[a-zA-Z0-9_-]{1,128}\z/
MAX_METADATA_KEYS =
50
MAX_METADATA_VALUE_SIZE =
1024
VALID_STATUS =
%w[open resolved ignored].freeze
PROBLEM_TITLE_MAX =
200

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ErrorStore

#count_occurrences, #get_occurrences, #get_problem, #get_server_event, #list_problems, #list_server_events, #occurrences_for_session, #save_occurrence, #save_server_event, #server_events_for_session, #session_ids_for_problem, #update_problem_status

Methods included from SessionStore

#delete_session, #delete_window, #each_session_events, #event_counts_by_day, #event_type_counts, #get_events, #get_session, #list_sessions, #purge_older_than, #save_events, #save_metadata

Instance Attribute Details

#limitsObject

Caps for eviction/scans. Defaults to Limits::DEFAULTS (static, not the global config); pass limits: Limits.from_configuration to bind it, or inject any other Limits to decouple a store from global state.



27
28
29
# File 'lib/sentiero/store.rb', line 27

def limits
  @limits ||= Limits.new
end

Instance Method Details

#supports_event_aggregates?Boolean

True when event_type_counts / event_counts_by_day avoid reading event payloads (native aggregates). Via the scan-based fallbacks each figure would re-scan the store, so StatsAggregator only calls them when true.

Returns:

  • (Boolean)


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

def supports_event_aggregates?
  false
end