Class: SplitIoClient::Telemetry::Storages::Memory
- Inherits:
-
Object
- Object
- SplitIoClient::Telemetry::Storages::Memory
- Defined in:
- lib/splitclient-rb/telemetry/storages/memory.rb
Instance Attribute Summary collapse
-
#auth_rejections ⇒ Object
readonly
Returns the value of attribute auth_rejections.
-
#events_data_records ⇒ Object
readonly
Returns the value of attribute events_data_records.
-
#exceptions ⇒ Object
readonly
Returns the value of attribute exceptions.
-
#factory_counters ⇒ Object
readonly
Returns the value of attribute factory_counters.
-
#http_errors ⇒ Object
readonly
Returns the value of attribute http_errors.
-
#http_latencies ⇒ Object
readonly
Returns the value of attribute http_latencies.
-
#impressions_data_records ⇒ Object
readonly
Returns the value of attribute impressions_data_records.
-
#last_synchronization ⇒ Object
readonly
Returns the value of attribute last_synchronization.
-
#latencies ⇒ Object
readonly
Returns the value of attribute latencies.
-
#session_length ⇒ Object
readonly
Returns the value of attribute session_length.
-
#streaming_events ⇒ Object
readonly
Returns the value of attribute streaming_events.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#token_refreshes ⇒ Object
readonly
Returns the value of attribute token_refreshes.
-
#updates_from_sse ⇒ Object
readonly
Returns the value of attribute updates_from_sse.
Instance Method Summary collapse
- #init_auth_rejections ⇒ Object
- #init_events_data_records ⇒ Object
- #init_exceptions ⇒ Object
- #init_factory_counters ⇒ Object
- #init_http_errors ⇒ Object
- #init_http_latencies ⇒ Object
- #init_impressions_data_records ⇒ Object
- #init_last_synchronization ⇒ Object
- #init_latencies ⇒ Object
- #init_session_length ⇒ Object
- #init_streaming_events ⇒ Object
- #init_tags ⇒ Object
- #init_token_refreshes ⇒ Object
- #init_updates_from_sse ⇒ Object
-
#initialize ⇒ Memory
constructor
A new instance of Memory.
Constructor Details
#initialize ⇒ Memory
Returns a new instance of Memory.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 22 def initialize init_latencies init_exceptions init_factory_counters init_impressions_data_records init_events_data_records init_last_synchronization init_http_errors init_http_latencies init_auth_rejections init_token_refreshes init_streaming_events init_session_length init_updates_from_sse end |
Instance Attribute Details
#auth_rejections ⇒ Object (readonly)
Returns the value of attribute auth_rejections.
7 8 9 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 7 def auth_rejections @auth_rejections end |
#events_data_records ⇒ Object (readonly)
Returns the value of attribute events_data_records.
7 8 9 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 7 def events_data_records @events_data_records end |
#exceptions ⇒ Object (readonly)
Returns the value of attribute exceptions.
7 8 9 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 7 def exceptions @exceptions end |
#factory_counters ⇒ Object (readonly)
Returns the value of attribute factory_counters.
7 8 9 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 7 def factory_counters @factory_counters end |
#http_errors ⇒ Object (readonly)
Returns the value of attribute http_errors.
7 8 9 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 7 def http_errors @http_errors end |
#http_latencies ⇒ Object (readonly)
Returns the value of attribute http_latencies.
7 8 9 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 7 def http_latencies @http_latencies end |
#impressions_data_records ⇒ Object (readonly)
Returns the value of attribute impressions_data_records.
7 8 9 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 7 def impressions_data_records @impressions_data_records end |
#last_synchronization ⇒ Object (readonly)
Returns the value of attribute last_synchronization.
7 8 9 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 7 def last_synchronization @last_synchronization end |
#latencies ⇒ Object (readonly)
Returns the value of attribute latencies.
7 8 9 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 7 def latencies @latencies end |
#session_length ⇒ Object (readonly)
Returns the value of attribute session_length.
7 8 9 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 7 def session_length @session_length end |
#streaming_events ⇒ Object (readonly)
Returns the value of attribute streaming_events.
7 8 9 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 7 def streaming_events @streaming_events end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
7 8 9 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 7 def @tags end |
#token_refreshes ⇒ Object (readonly)
Returns the value of attribute token_refreshes.
7 8 9 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 7 def token_refreshes @token_refreshes end |
#updates_from_sse ⇒ Object (readonly)
Returns the value of attribute updates_from_sse.
7 8 9 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 7 def updates_from_sse @updates_from_sse end |
Instance Method Details
#init_auth_rejections ⇒ Object
135 136 137 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 135 def init_auth_rejections @auth_rejections = Concurrent::AtomicFixnum.new(0) end |
#init_events_data_records ⇒ Object
87 88 89 90 91 92 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 87 def init_events_data_records @events_data_records = Concurrent::Array.new @events_data_records << { type: Domain::Constants::EVENTS_DROPPED, value: Concurrent::AtomicFixnum.new(0) } @events_data_records << { type: Domain::Constants::EVENTS_QUEUED, value: Concurrent::AtomicFixnum.new(0) } end |
#init_exceptions ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 56 def init_exceptions @exceptions = Concurrent::Array.new treatment_with_config_by_flag_set_const = Domain::Constants::TREATMENTS_WITH_CONFIG_BY_FLAG_SET treatment_with_config_by_flag_sets_const = Domain::Constants::TREATMENTS_WITH_CONFIG_BY_FLAG_SETS @exceptions << { method: Domain::Constants::TREATMENT, exceptions: Concurrent::AtomicFixnum.new(0) } @exceptions << { method: Domain::Constants::TREATMENTS, exceptions: Concurrent::AtomicFixnum.new(0) } @exceptions << { method: Domain::Constants::TREATMENT_WITH_CONFIG, exceptions: Concurrent::AtomicFixnum.new(0) } @exceptions << { method: Domain::Constants::TREATMENTS_WITH_CONFIG, exceptions: Concurrent::AtomicFixnum.new(0) } @exceptions << { method: Domain::Constants::TREATMENTS_BY_FLAG_SET, exceptions: Concurrent::AtomicFixnum.new(0) } @exceptions << { method: Domain::Constants::TREATMENTS_BY_FLAG_SETS, exceptions: Concurrent::AtomicFixnum.new(0) } @exceptions << { method: treatment_with_config_by_flag_set_const, exceptions: Concurrent::AtomicFixnum.new(0) } @exceptions << { method: treatment_with_config_by_flag_sets_const, exceptions: Concurrent::AtomicFixnum.new(0) } @exceptions << { method: Domain::Constants::TRACK, exceptions: Concurrent::AtomicFixnum.new(0) } end |
#init_factory_counters ⇒ Object
72 73 74 75 76 77 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 72 def init_factory_counters @factory_counters = Concurrent::Array.new @factory_counters << { action: Domain::Constants::BUR_TIMEOUT, counts: Concurrent::AtomicFixnum.new(0) } @factory_counters << { action: Domain::Constants::NON_READY_USAGES, counts: Concurrent::AtomicFixnum.new(0) } end |
#init_http_errors ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 110 def init_http_errors @http_errors = Concurrent::Array.new @http_errors << { type: Domain::Constants::SPLIT_SYNC, value: Concurrent::Hash.new } @http_errors << { type: Domain::Constants::SEGMENT_SYNC, value: Concurrent::Hash.new } @http_errors << { type: Domain::Constants::EVENT_SYNC, value: Concurrent::Hash.new } @http_errors << { type: Domain::Constants::IMPRESSION_COUNT_SYNC, value: Concurrent::Hash.new } @http_errors << { type: Domain::Constants::IMPRESSIONS_SYNC, value: Concurrent::Hash.new } @http_errors << { type: Domain::Constants::TELEMETRY_SYNC, value: Concurrent::Hash.new } @http_errors << { type: Domain::Constants::TOKEN_SYNC, value: Concurrent::Hash.new } end |
#init_http_latencies ⇒ Object
122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 122 def init_http_latencies @http_latencies = Concurrent::Array.new array_size = BinarySearchLatencyTracker::BUCKETS.length @http_latencies << { type: Domain::Constants::SPLIT_SYNC, value: Concurrent::Array.new(array_size, 0) } @http_latencies << { type: Domain::Constants::SEGMENT_SYNC, value: Concurrent::Array.new(array_size, 0) } @http_latencies << { type: Domain::Constants::EVENT_SYNC, value: Concurrent::Array.new(array_size, 0) } @http_latencies << { type: Domain::Constants::IMPRESSION_COUNT_SYNC, value: Concurrent::Array.new(array_size, 0) } @http_latencies << { type: Domain::Constants::IMPRESSIONS_SYNC, value: Concurrent::Array.new(array_size, 0) } @http_latencies << { type: Domain::Constants::TELEMETRY_SYNC, value: Concurrent::Array.new(array_size, 0) } @http_latencies << { type: Domain::Constants::TOKEN_SYNC, value: Concurrent::Array.new(array_size, 0) } end |
#init_impressions_data_records ⇒ Object
79 80 81 82 83 84 85 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 79 def init_impressions_data_records @impressions_data_records = Concurrent::Array.new @impressions_data_records << { type: Domain::Constants::IMPRESSIONS_DEDUPE, value: Concurrent::AtomicFixnum.new(0) } @impressions_data_records << { type: Domain::Constants::IMPRESSIONS_DROPPED, value: Concurrent::AtomicFixnum.new(0) } @impressions_data_records << { type: Domain::Constants::IMPRESSIONS_QUEUED, value: Concurrent::AtomicFixnum.new(0) } end |
#init_last_synchronization ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 94 def init_last_synchronization @last_synchronization = Concurrent::Array.new @last_synchronization << { type: Domain::Constants::SPLIT_SYNC, value: Concurrent::AtomicFixnum.new(0) } @last_synchronization << { type: Domain::Constants::SEGMENT_SYNC, value: Concurrent::AtomicFixnum.new(0) } @last_synchronization << { type: Domain::Constants::EVENT_SYNC, value: Concurrent::AtomicFixnum.new(0) } @last_synchronization << { type: Domain::Constants::IMPRESSION_COUNT_SYNC, value: Concurrent::AtomicFixnum.new(0) } @last_synchronization << { type: Domain::Constants::IMPRESSIONS_SYNC, value: Concurrent::AtomicFixnum.new(0) } @last_synchronization << { type: Domain::Constants::TELEMETRY_SYNC, value: Concurrent::AtomicFixnum.new(0) } @last_synchronization << { type: Domain::Constants::TOKEN_SYNC, value: Concurrent::AtomicFixnum.new(0) } end |
#init_latencies ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 39 def init_latencies @latencies = Concurrent::Array.new treatment_with_config_by_flag_set_const = Domain::Constants::TREATMENTS_WITH_CONFIG_BY_FLAG_SET treatment_with_config_by_flag_sets_const = Domain::Constants::TREATMENTS_WITH_CONFIG_BY_FLAG_SETS array_size = BinarySearchLatencyTracker::BUCKETS.length @latencies << { method: Domain::Constants::TREATMENT, latencies: Concurrent::Array.new(array_size, 0) } @latencies << { method: Domain::Constants::TREATMENTS, latencies: Concurrent::Array.new(array_size, 0) } @latencies << { method: Domain::Constants::TREATMENT_WITH_CONFIG, latencies: Concurrent::Array.new(array_size, 0) } @latencies << { method: Domain::Constants::TREATMENTS_WITH_CONFIG, latencies: Concurrent::Array.new(array_size, 0) } @latencies << { method: Domain::Constants::TREATMENTS_BY_FLAG_SET, latencies: Concurrent::Array.new(array_size, 0) } @latencies << { method: Domain::Constants::TREATMENTS_BY_FLAG_SETS, latencies: Concurrent::Array.new(array_size, 0) } @latencies << { method: treatment_with_config_by_flag_set_const, latencies: Concurrent::Array.new(array_size, 0) } @latencies << { method: treatment_with_config_by_flag_sets_const, latencies: Concurrent::Array.new(array_size, 0) } @latencies << { method: Domain::Constants::TRACK, latencies: Concurrent::Array.new(array_size, 0) } end |
#init_session_length ⇒ Object
147 148 149 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 147 def init_session_length @session_length = Concurrent::AtomicFixnum.new(0) end |
#init_streaming_events ⇒ Object
143 144 145 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 143 def init_streaming_events @streaming_events = Concurrent::Array.new end |
#init_tags ⇒ Object
106 107 108 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 106 def @tags = Concurrent::Array.new end |
#init_token_refreshes ⇒ Object
139 140 141 |
# File 'lib/splitclient-rb/telemetry/storages/memory.rb', line 139 def init_token_refreshes @token_refreshes = Concurrent::AtomicFixnum.new(0) end |