[ 
https://issues.apache.org/jira/browse/BEAM-8523?focusedWorklogId=352270&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-352270
 ]

ASF GitHub Bot logged work on BEAM-8523:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Dec/19 22:29
            Start Date: 02/Dec/19 22:29
    Worklog Time Spent: 10m 
      Work Description: chadrik commented on pull request #9959: [BEAM-8523] 
JobAPI: Give access to timestamped state change history
URL: https://github.com/apache/beam/pull/9959#discussion_r352893649
 
 

 ##########
 File path: sdks/python/apache_beam/runners/portability/abstract_job_service.py
 ##########
 @@ -16,16 +16,36 @@
 #
 from __future__ import absolute_import
 
+import itertools
 import logging
 import uuid
 from builtins import object
 
+from google.protobuf import timestamp_pb2
+
 from apache_beam.portability.api import beam_job_api_pb2
 from apache_beam.portability.api import beam_job_api_pb2_grpc
+from apache_beam.utils import proto_utils
+from apache_beam.utils.timestamp import Timestamp
 
 _LOGGER = logging.getLogger(__name__)
 
 
+def make_state_event(state, timestamp):
+  if isinstance(timestamp, Timestamp):
+    proto_timestamp = timestamp.to_proto()
+  elif isinstance(timestamp, timestamp_pb2.Timestamp):
+    proto_timestamp = timestamp
+  elif isinstance(timestamp, float):
 
 Review comment:
   Fixed.   At the time I thought it could be useful for an end-user 
implementing their own job service, but it's not too much to ask call 
`Timestamp.now()`.  
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 352270)
    Time Spent: 5h 10m  (was: 5h)

> Add useful timestamp to job servicer GetJobs
> --------------------------------------------
>
>                 Key: BEAM-8523
>                 URL: https://issues.apache.org/jira/browse/BEAM-8523
>             Project: Beam
>          Issue Type: New Feature
>          Components: beam-model
>            Reporter: Chad Dombrova
>            Assignee: Chad Dombrova
>            Priority: Major
>          Time Spent: 5h 10m
>  Remaining Estimate: 0h
>
> As a user querying jobs with JobService.GetJobs, it would be useful if the 
> JobInfo result contained timestamps indicating various state changes that may 
> have been missed by a client.   Useful timestamps include:
>  
>  * submitted (prepared to the job service)
>  * started (executor enters the RUNNING state)
>  * completed (executor enters a terminal state)
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to