Lines Matching refs:hqe
81 for hqe in self._job.hostqueueentry_set.all().prefetch_related('host'):
82 _mark_hqe_aborted(hqe)
179 for hqe in self._job.hostqueueentry_set.all():
180 self._set_completed_status(hqe, final_status)
207 def _set_completed_status(self, hqe, status): argument
213 hqe.status = status
214 hqe.active = False
215 hqe.complete = True
216 if hqe.started_on:
217 hqe.finished_on = datetime.datetime.now()
218 hqe.save(update_fields=['status', 'active', 'complete', 'finished_on'])
219 self._metrics.send_hqe_completion(hqe)
220 self._metrics.send_hqe_duration(hqe)
257 def send_hqe_completion(self, hqe): argument
260 'status': hqe.status.lower(),
264 if hqe.host:
266 labels = labellib.LabelsMapping.from_host(hqe.host)
271 def send_hqe_duration(self, hqe): argument
273 if not (hqe.started_on and hqe.finished_on):
281 'HQE', spanId='0', traceId=hqe_trace_id(hqe.id))
283 span.startTime.FromDatetime(hqe.started_on)
285 span.endTime.FromDatetime(hqe.finished_on)
296 def _mark_hqe_aborted(hqe): argument
307 if hqe.status in (Status.GATHERING, Status.PARSING):
309 if hqe.status in (Status.STARTING, Status.PENDING, Status.RUNNING):
310 if hqe.host is None:
312 hqe.host.status = models.Host.Status.READY
313 hqe.host.save(update_fields=['status'])
314 hqe.status = Status.ABORTED
315 hqe.save(update_fields=['status'])
327 for hqe in entries_to_stop:
328 if hqe.status == HQEStatus.PENDING:
329 hqe.host.status = HostStatus.READY
330 hqe.host.save(update_fields=['status'])
331 hqe.status = HQEStatus.STOPPED
332 hqe.save(update_fields=['status'])