Skip to content

Commit

Permalink
Introduce user state metrics
Browse files Browse the repository at this point in the history
Co-authored-by: Saray Cabrera Padrón <scabrerapadron@suse.de>
  • Loading branch information
eduardoj and saraycp committed Oct 30, 2020
1 parent 8edff30 commit 0e911e7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/api/app/jobs/measurements_job.rb
Expand Up @@ -3,6 +3,12 @@ class MeasurementsJob < ApplicationJob

def perform
RabbitmqBus.send_to_bus('metrics', "group count=#{Group.count}")
RabbitmqBus.send_to_bus('metrics', "user in_beta=#{User.in_beta.count},in_rollout=#{User.in_rollout.count},count=#{User.count}")
RabbitmqBus.send_to_bus('metrics', "user in_beta=#{User.in_beta.count},in_rollout=#{User.in_rollout.count},count=#{User.count},#{state_fields}")
end

private

def state_fields
User::STATES.map { |state| "#{state}=#{User.where(state: state).count}" }.join(',')
end
end

0 comments on commit 0e911e7

Please sign in to comment.