lint
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
parent
82e27a7458
commit
4a6f956c28
|
@ -41,9 +41,11 @@ class SystemTaskSerializer(ModelSerializer):
|
|||
return instance.name
|
||||
|
||||
def get_start_timestamp(self, instance: SystemTask) -> datetime:
|
||||
"""Timestamp when the task started"""
|
||||
return datetime.fromtimestamp(instance.start_timestamp, tz=timezone.utc)
|
||||
|
||||
def get_finish_timestamp(self, instance: SystemTask) -> datetime:
|
||||
"""Timestamp when the task finished"""
|
||||
return datetime.fromtimestamp(instance.finish_timestamp, tz=timezone.utc)
|
||||
|
||||
def get_duration(self, instance: SystemTask) -> float:
|
||||
|
|
|
@ -625,13 +625,13 @@ class SystemTask(SerializerModel, ExpiringModel):
|
|||
duration = max(self.finish_timestamp - self.start_timestamp, 0)
|
||||
# TODO: Deprecated metric - remove in 2024.2 or later
|
||||
GAUGE_TASKS.labels(
|
||||
task_name=self.name.split(":")[0],
|
||||
task_name=self.name,
|
||||
task_uid=self.uid or "",
|
||||
status=self.status.lower(),
|
||||
).set(duration)
|
||||
SYSTEM_TASK_TIME.observe(duration)
|
||||
SYSTEM_TASK_STATUS.labels(
|
||||
task_name=self.name.split(":")[0],
|
||||
task_name=self.name,
|
||||
task_uid=self.uid or "",
|
||||
status=self.status.lower(),
|
||||
).inc()
|
||||
|
|
|
@ -42719,10 +42719,12 @@ components:
|
|||
start_timestamp:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Timestamp when the task started
|
||||
readOnly: true
|
||||
finish_timestamp:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Timestamp when the task finished
|
||||
readOnly: true
|
||||
duration:
|
||||
type: number
|
||||
|
|
Reference in a new issue