8000 Fix durations in D3 graph (fixes #2620) by MichaelGrupp · Pull Request #2624 · spotify/luigi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix durations in D3 graph (fixes #2620) #2624

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

Merged
merged 2 commits into from
Mar 13, 2019

Conversation

MichaelGrupp
Copy link
Contributor

Fixes the duration calculation. Both date objects startTime and
finishTime are in milliseconds, so the additional multiplication with
1000 was wrong.

Also, the duration is now calculated with:

duration = last_updated - time_running

as it is done also in

time_elapse = task.updated - task.time_running

The display format was also problematic, because it only displayed the
seconds of the Date object, i.e. always less than 60 seconds. Now it
uses the hh:mm:ss:f format.

I decided to not display the time if the duration is longer than a day,
because then it gets messy with the Date objects (would require a
conversion to day of year, not day of month).

Copy link
Contributor
@Tarrasch Tarrasch left a comment

Choose a reason for hiding this comment

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

Not so citrical code, but can you get a colleague to review this?

});
} else {
g.setEdge(task.inputQueue[i], task.taskId, {
label: "> 24h",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove this repetition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the slow response. Fixed in the latest commit.

Fixes the duration calculation. Both date objects `startTime` and
`finishTime` are in milliseconds, so the additional multiplication with
1000 was wrong.

Also, the duration is now calculated with:
   duration = last_updated - time_running
as it is done in datadog_metric.py:83

I decided to not display the time if the duration is longer than a day,
because then it gets messy with the Date objects (would require a
conversion to day of year, not day of month).
@MichaelGrupp
Copy link
Contributor Author

We tested this patch with a bunch of pipelines and it worked fine.

In the long run, I think it makes sense to refactor the code so that the durations are displayed in the node box - but I suggest to merge this first so we don't have wrong values anymore :)

@dlstadther dlstadther merged commit 31a6e0f into spotify:mast 7DDC er Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0