Skip to content

Commit

Permalink
Merge pull request #14600 from bmwiedemann/worker_status_daemon
Browse files Browse the repository at this point in the history
Send metrics about daemon availability
  • Loading branch information
hennevogel committed Jul 4, 2023
2 parents 39ef4b9 + 4348c8e commit cd22d5c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/api/app/jobs/worker_measurements_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def perform
send_worker_metrics
send_job_metrics
send_scheduler_metrics
send_daemon_metrics
end

private
Expand Down Expand Up @@ -50,4 +51,16 @@ def send_scheduler_metrics
end
end
end

def send_daemon_metrics
@workerstatus.xpath('//partition/daemon').each do |daemon|
partition = daemon.parent.values.first
type = daemon.attributes['type'].value
state = daemon.attributes['state'].value
starttime = daemon.attributes['starttime'].value
arch = daemon.attributes['arch']
arch = (arch.nil? ? '' : ",arch=#{arch.value}")
RabbitmqBus.send_to_bus('metrics', "backend_daemon_status,partition=#{partition},type=#{type},state=#{state}#{arch} starttime=#{starttime}")
end
end
end

0 comments on commit cd22d5c

Please sign in to comment.