Skip to content

Commit

Permalink
Fix job duration display (#471)
Browse files Browse the repository at this point in the history
* Fix job duration display

Job execution duration display cannot go above 24h.
The moment.format function can only generate days between 1 and 31.
For durations > 24h, we display days explicitly

* Bump version to 0.9.17
  • Loading branch information
bubblesly authored Oct 3, 2019
1 parent 09e08c8 commit 47a5404
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
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

0 comments on commit 47a5404

Please sign in to comment.