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

Fix job duration display #471

Merged
merged 4 commits into from
Oct 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ To run the example application, checkout the repository, launch the [sbt](http:/

The library is cross-built for __Scala 2.11__ and __Scala 2.12__.

The core module to use is `"com.criteo.cuttle" %% "cuttle" % "0.9.16"`.
The core module to use is `"com.criteo.cuttle" %% "cuttle" % "0.9.17"`.

You also need to fetch one __Scheduler__ implementation:
- __TimeSeries__: `"com.criteo.cuttle" %% "timeseries" % "0.9.16""`.
- __Cron__: `"com.criteo.cuttle" %% "cron" % "0.9.16""`.
- __TimeSeries__: `"com.criteo.cuttle" %% "timeseries" % "0.9.17""`.
- __Cron__: `"com.criteo.cuttle" %% "cron" % "0.9.17""`.

# License

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
val devMode = settingKey[Boolean]("Some build optimization are applied in devMode.")
val writeClasspath = taskKey[File]("Write the project classpath to a file.")

val VERSION = "0.9.16"
val VERSION = "0.9.17"

lazy val catsCore = "1.6.1"
lazy val circe = "0.11.1"
Expand Down
27 changes: 13 additions & 14 deletions timeseries/src/main/javascript/app/pages/Execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,23 +284,22 @@ class Execution extends React.Component<Props, State> {
? [
<dt key="duration">Duration:</dt>,
<dd key="duration_">
{data.endTime ? (
[
moment
.utc(
moment(data.endTime).diff(moment(data.startTime))
)
.format("HH:mm:ss"),
<ProgressBar
{data.endTime ? (
(() => {
const duration = moment(data.endTime).diff(moment(data.startTime))
const timePart = moment
.utc(duration)
.format("HH:mm:ss")
const dayPart = moment.duration(duration).days()
const durationMsg = (dayPart === 0) ? timePart : `${dayPart} days ${timePart}`
const progressBar = <ProgressBar
key="progressBar"
totalTimeSeconds={
moment(data.endTime).diff(
moment(data.startTime)
) / 1000
}
totalTimeSeconds = {duration / 1000}
waitingTimeSeconds={data.waitingSeconds}
/>
]
return [durationMsg, progressBar]
}
)()
) : (
<Clock time={data.startTime} humanize={false} />
)}
Expand Down