MutableList isn't threadsafe. Two threads could here get the reference to the same non-thread-safe object and attempt to modify it.

You can implement what you want (I think) with a lock like this:

```scala

{
  private val metricsMonitor = new Object

  @GuardedBy("metricsMonitor")
  private var storedMetrics = List[Long]()

  override def recordTimeSpent(duration: Long) {
    metricsMonitor.synchronized {
      storedMetrics = duration :: storedMetrics
    }
    masterMetric.recordTimeSpent(durationInMillis)
  }

  def processMetrics() {
    val metrics = metricsMonitor.synchronized { 
      val currentMetrics = storedMetrics
      storedMetrics = Nil
      currentMetrics
    }

    // ... everything else
  }
}
```

Although concurrent mutable list collections exist (CopyOnWriteArrayList & ConcurrentLinkedQueue) I don't think either supports atomically emptying the collection.