Commit 0e19bad4 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

don't flush null values

parent dfa0148c
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -16,13 +16,17 @@ trait AbstractBucket {

  def flush_every(interval: Long, proc: (Long, Double) => Unit) = {
    val now = FnordMetric.now
    var triggered = (next_flush == 0)

    if (next_flush == 0)
    if (triggered)
      next_flush = now

    while (next_flush <= now) {
      if (!triggered)
        proc(next_flush, flush)

      next_flush += interval
      triggered = true
    }
  }