This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoggingScheduledThreadPoolExecutor(nthreads: Int) | |
extends ScheduledThreadPoolExecutor(nthreads) { | |
private val log = Logger(LoggerFactory.getLogger(classOf[LoggingScheduledThreadPoolExecutor])) | |
class CustomTask[T](runnable: AnyRef, task: RunnableScheduledFuture[T]) | |
extends RunnableScheduledFuture[T] { | |
val creationTime = System.nanoTime() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoggingScheduledThreadPoolExecutor(nthreads: Int) | |
extends ScheduledThreadPoolExecutor(nthreads) { | |
private val log = Logger(LoggerFactory.getLogger(classOf[LoggingScheduledThreadPoolExecutor])) | |
override def submit[T](task: Runnable, result: T): java.util.concurrent.Future[T] = { | |
val queueTime = System.nanoTime() | |
log debug s"Submit task $task" | |
super.submit(new Runnable { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* stress test a JUnit test | |
given your test body: | |
feature(a) { | |
} | |
... | |
feature(c) { | |
} | |
wrap it: |
NewerOlder