Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers/gitlab_experiment.rb')
-rw-r--r--config/initializers/gitlab_experiment.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/config/initializers/gitlab_experiment.rb b/config/initializers/gitlab_experiment.rb
index 055979bb66b..40c706ea922 100644
--- a/config/initializers/gitlab_experiment.rb
+++ b/config/initializers/gitlab_experiment.rb
@@ -2,16 +2,15 @@
Gitlab::Experiment.configure do |config|
config.base_class = 'ApplicationExperiment'
+ config.mount_at = '/-/experiment'
config.cache = Gitlab::Experiment::Cache::RedisHashStore.new(
pool: ->(&block) { Gitlab::Redis::SharedState.with { |redis| block.call(redis) } }
)
-
- # TODO: This will be deprecated as of v0.6.0, but needs to stay intact for
- # actively running experiments until a versioning concept is put in place to
- # enable migrating into the new SHA2 strategy.
- config.context_hash_strategy = lambda do |source, seed|
- source = source.keys + source.values if source.is_a?(Hash)
- data = Array(source).map { |v| (v.respond_to?(:to_global_id) ? v.to_global_id : v).to_s }
- Digest::MD5.hexdigest(data.unshift(seed).join('|'))
+ config.tracking_behavior = lambda do |action, event_args|
+ Gitlab::Tracking.event(name, action.to_s, **event_args.merge(
+ context: (event_args[:context] || []) << SnowplowTracker::SelfDescribingJson.new(
+ 'iglu:com.gitlab/gitlab_experiment/jsonschema/1-0-0', signature
+ )
+ ))
end
end