Skip to content

Instantly share code, notes, and snippets.

View adriansr's full-sized avatar

Adrian Serrano adriansr

View GitHub Profile
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()
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 {
/* stress test a JUnit test
given your test body:
feature(a) {
}
...
feature(c) {
}
wrap it: