Skip to content

Commit

Permalink
feat: add supervisor ID to DAQJobHandleStats data handling
Browse files Browse the repository at this point in the history
  • Loading branch information
furkan-bilgin committed Nov 26, 2024
1 parent c104404 commit 4c2b774
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/enrgdaq/daq/jobs/handle_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def handle_message(self, message: DAQJobMessageStats) -> bool:
return False

keys = [
"supervisor",
"daq_job",
"is_alive",
"last_message_in_date",
Expand All @@ -66,10 +67,15 @@ def unpack_record(record: DAQJobStatsRecord):
record.count,
]

if message.daq_job_info and message.daq_job_info.supervisor_config:
supervisor_id = message.daq_job_info.supervisor_config.supervisor_id
else:
supervisor_id = "N/A"
data_to_send = []
for daq_job_type, msg in message.stats.items():
data_to_send.append(
[
supervisor_id,
daq_job_type.__name__,
str(msg.is_alive).lower(),
*unpack_record(msg.message_in_stats),
Expand Down

0 comments on commit 4c2b774

Please sign in to comment.