Class: Labkit::Middleware::Sidekiq::UserExperienceSli::Client Private
- Inherits:
-
Object
- Object
- Labkit::Middleware::Sidekiq::UserExperienceSli::Client
- Defined in:
- lib/labkit/middleware/sidekiq/user_experience_sli/client.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
This middleware for Sidekiq-client wraps scheduling jobs with covered experience context. It retrieves the current experiences and populates the job with them.
Instance Method Summary collapse
Instance Method Details
#call(worker_class, job, _queue, _redis_pool) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/labkit/middleware/sidekiq/user_experience_sli/client.rb', line 13 def call(worker_class, job, _queue, _redis_pool) data = Labkit::UserExperienceSli::Current.active_experiences.inject({}) do |data, (_, xp)| xp.checkpoint(checkpoint_action: "sidekiq_job_scheduled", worker: worker_class.to_s) data.merge!(xp.to_h) end job[Labkit::UserExperienceSli::Current::AGGREGATION_KEY] = data unless data.empty? yield end |