-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add start time and duration to tasks #16829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -50,17 +51,24 @@ | |||
|
|||
private final String description; | |||
|
|||
private final long startTime; | |||
|
|||
private final long runningTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we need to send this over the wire though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We either have to send it over the wire or synchronize clocks on all nodes. Otherwise, users might get negative running times, which just look weird. I think sending this over the wire is a simpler solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ Leave a comment to that effect?
Hurray! I left some minor comments, all of which you can feel free to say "no, I like it the way it is, thank you". I think it'd tell a great story if you added "get me tasks that have been running longer than X seconds" to the task list API in this PR. It'd make it super obvious why this is important. But this PR is fine as is if you want. |
To make it official, LGTM. |
@nik9000 I pushed changes to address your comments. What do you think? |
@@ -50,17 +51,24 @@ | |||
|
|||
private final String description; | |||
|
|||
private final long startTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe these should be TimeValue
s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Err, the next one a TimeValue, this one a DateTime or something? Its not required, at all and I just thought of it but a TimeValue would make runningTimeNanos easier to read I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a transport format, which is easier to work with. We do convert this long to a TimeValue in XContentBuilder#timeValueField() if a user requests human
readable output. It also happens to dates in XContentBuilder#dateValueField(). So, I don't think storing it here in milliseconds and nanoseconds will affect readability.
Fair enough. LGTM. |
Tasks now contain timestamps indicating when the tasks were created and current run time
c55926d
to
863fab4
Compare
Tasks now contain timestamps indicating when the tasks were created and current run time