`foldLeft(0)(math.max)` is much nicer than my offline suggestion
`reduceOption(math.max).getOrElse(0)`.


On Tue, Dec 10, 2013 at 3:15 PM, Alexandre Bergeron <
notifications@github.com> wrote:

> In spnl-core/src/main/scala/com/wajam/spnl/Task.scala:
>
> > @@ -28,6 +29,9 @@ class Task(feeder: Feeder, val action: TaskAction, val persistence: TaskPersiste
> >    private lazy val retryCounter = metrics.counter("retry-count", name)
> >    private lazy val concurrentCounter = metrics.counter("concurrent-count", name)
> >    private lazy val processedCounter = metrics.counter("processed-count", name)
> > +  private lazy val maxRetryGauge = metrics.gauge("max-retry-count", name) {
> > +    currentAttempts.values.map(_.taskData.retryCount).max
>
> or `currentAttempts.values.foldLeft(0)(math.max)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/wajam/spnl/pull/63/files#r8245587>
> .
>