1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 20:09:11 +00:00

Fix timstampts to be UTC.

This commit is contained in:
Sergei Trofimov 2017-03-20 16:27:58 +00:00
parent 31a5e5b5fe
commit 1d0db35e04
2 changed files with 5 additions and 5 deletions

View File

@ -107,7 +107,7 @@ class ExecutionContext(object):
self.failed_jobs = 0
def start_run(self):
self.output.info.start_time = datetime.now()
self.output.info.start_time = datetime.utcnow()
self.output.write_info()
self.job_queue = copy(self.cm.jobs)
self.completed_jobs = []
@ -125,7 +125,7 @@ class ExecutionContext(object):
status = Status.FAILED
self.run_state.status = status
self.output.status = status
self.output.info.end_time = datetime.now()
self.output.info.end_time = datetime.utcnow()
self.output.info.duration = self.output.info.end_time -\
self.output.info.start_time
self.output.write_info()

View File

@ -81,7 +81,7 @@ class RunState(object):
def __init__(self):
self.jobs = OrderedDict()
self.status = Status.NEW
self.timestamp = datetime.now()
self.timestamp = datetime.utcnow()
def add_job(self, job):
job_state = JobState(job.id, job.label, job.iteration, job.status)
@ -90,7 +90,7 @@ class RunState(object):
def update_job(self, job):
state = self.jobs[(job.id, job.iteration)]
state.status = job.status
state.timestamp = datetime.now()
state.timestamp = datetime.utcnow()
def get_status_counts(self):
counter = Counter()
@ -126,7 +126,7 @@ class JobState(object):
self.iteration = iteration
self.status = status
self.retries = 0
self.timestamp = datetime.now()
self.timestamp = datetime.utcnow()
def to_pod(self):
return OrderedDict(