Add performance test

This commit is contained in:
Leonard Ehrenfried 2017-11-08 13:43:03 +01:00
parent 48f9cf3be6
commit 3cc56ad0ba
No known key found for this signature in database
GPG Key ID: 56CCB7F9445717AF
1 changed files with 12 additions and 0 deletions

View File

@ -20,6 +20,18 @@ class ManagedLoggerSpec extends FlatSpec with Matchers {
log.infoEvent(1)
}
it should "validate performance improvement of disabling location calculation for async loggers" in {
val log = LogExchange.logger("foo")
LogExchange.bindLoggerAppenders("foo", List(LogExchange.asyncStdout -> Level.Info))
val before = System.currentTimeMillis()
1 to 10000 foreach { _ =>
log.debug("test")
}
val after = System.currentTimeMillis()
log.info(s"Peformance test took: ${after - before}ms")
}
it should "support logging Throwable out of the box" in {
import sbt.internal.util.codec.JsonProtocol._
val log = LogExchange.logger("foo")