Module: Gitlab
- Defined in:
- lib/gitlab/experiment/rollout/random.rb,
lib/gitlab/experiment.rb,
lib/gitlab/experiment/dsl.rb,
lib/gitlab/experiment/cache.rb,
lib/gitlab/experiment/rspec.rb,
lib/gitlab/experiment/engine.rb,
lib/gitlab/experiment/errors.rb,
lib/gitlab/experiment/context.rb,
lib/gitlab/experiment/cookies.rb,
lib/gitlab/experiment/rollout.rb,
lib/gitlab/experiment/variant.rb,
lib/gitlab/experiment/version.rb,
lib/gitlab/experiment/nestable.rb,
lib/gitlab/experiment/callbacks.rb,
lib/gitlab/experiment/middleware.rb,
lib/gitlab/experiment/configuration.rb,
lib/gitlab/experiment/base_interface.rb,
lib/gitlab/experiment/rollout/percent.rb,
lib/gitlab/experiment/rollout/round_robin.rb,
lib/gitlab/experiment/cache/redis_hash_store.rb,
lib/gitlab/experiment/test_behaviors/trackable.rb,
lib/generators/gitlab/experiment/experiment_generator.rb,
lib/generators/gitlab/experiment/install/install_generator.rb
Overview
This cache strategy is an implementation on top of the redis hash data type, that also adheres to the ActiveSupport::Cache::Store interface. It’s a good example of how to build a custom caching strategy for Gitlab::Experiment, and is intended to be a long lived cache – until the experiment is cleaned up.
The data structure:
key: experiment.name
fields: context key => variant name
Example configuration usage:
config.cache = Gitlab::Experiment::Cache::RedisHashStore.new(
pool: ->(&block) { block.call(Redis.current) }
)
Defined Under Namespace
Modules: Generators Classes: Experiment