Skip to content
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

Add start time and duration to tasks #16829

Merged
merged 1 commit into from
Feb 27, 2016

Conversation

imotov
Copy link
Contributor

@imotov imotov commented Feb 26, 2016

Tasks now contain timestamps indicating when the tasks were created and current run time

@imotov imotov added >enhancement review v5.0.0-alpha1 :Distributed/Task Management Issues for anything around the Tasks API - both persistent and node level. labels Feb 26, 2016
@@ -50,17 +51,24 @@

private final String description;

private final long startTime;

private final long runningTime;
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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?

@nik9000
Copy link
Member

nik9000 commented Feb 26, 2016

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.

@nik9000
Copy link
Member

nik9000 commented Feb 26, 2016

To make it official, LGTM.

@imotov
Copy link
Contributor Author

imotov commented Feb 26, 2016

@nik9000 I pushed changes to address your comments. What do you think?

@@ -50,17 +51,24 @@

private final String description;

private final long startTime;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe these should be TimeValues?

Copy link
Member

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.

Copy link
Contributor Author

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.

@nik9000
Copy link
Member

nik9000 commented Feb 26, 2016

Fair enough. LGTM.

Tasks now contain timestamps indicating when the tasks were created and current run time
@imotov imotov merged commit 863fab4 into elastic:master Feb 27, 2016
@imotov imotov mentioned this pull request Feb 29, 2016
12 tasks
@imotov imotov deleted the change-tasks-rest-api branch May 1, 2020 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Task Management Issues for anything around the Tasks API - both persistent and node level. >enhancement v5.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants