From fe9d4384ae560a67f4817825c7ac51dd6d981b6c Mon Sep 17 00:00:00 2001 From: Vyacheslav Artemyev Date: Thu, 7 Mar 2019 14:44:05 +0200 Subject: [PATCH 1/2] Add logback & change params for JHM --- .gitignore | 4 ++++ .../ConfirmPublisherBenchmark.kt | 4 ++-- benchmarks/src/jmh/resources/logback.xml | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 benchmarks/src/jmh/resources/logback.xml diff --git a/.gitignore b/.gitignore index c8df95eb..fbac7528 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,7 @@ build/ #tmp CONTENT.md + +#JMH +benchmarks.jar + diff --git a/benchmarks/src/jmh/kotlin/com.viartemev.thewhiterabbit/ConfirmPublisherBenchmark.kt b/benchmarks/src/jmh/kotlin/com.viartemev.thewhiterabbit/ConfirmPublisherBenchmark.kt index 80194dbe..22563f8e 100644 --- a/benchmarks/src/jmh/kotlin/com.viartemev.thewhiterabbit/ConfirmPublisherBenchmark.kt +++ b/benchmarks/src/jmh/kotlin/com.viartemev.thewhiterabbit/ConfirmPublisherBenchmark.kt @@ -32,12 +32,12 @@ import java.util.concurrent.TimeUnit @Warmup(iterations = 5, time = 5, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 1, time = 5, timeUnit = TimeUnit.SECONDS) @Fork(value = 2) -@BenchmarkMode(Mode.Throughput) +@BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.MICROSECONDS) @State(Scope.Benchmark) open class ConfirmPublisherBenchmark { - @Param("1") + @Param("1", "10", "100", "1000", "10000", "100000") private var numberOfMessages: Int = 0 private val testQueueName = "jmh_test_queue" private lateinit var connection: Connection diff --git a/benchmarks/src/jmh/resources/logback.xml b/benchmarks/src/jmh/resources/logback.xml new file mode 100644 index 00000000..8b857157 --- /dev/null +++ b/benchmarks/src/jmh/resources/logback.xml @@ -0,0 +1,17 @@ + + + + %highlight(%d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n) + + + + + + %msg%n + + + + + + + From f9ce22f743742f2ca7c419c33e1da7a342b8679f Mon Sep 17 00:00:00 2001 From: Vyacheslav Artemyev Date: Thu, 7 Mar 2019 15:33:09 +0200 Subject: [PATCH 2/2] Temporary remove spring tests --- .../com/example/CoroutinesApplicationTests.kt | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 the-white-rabbit-spring-boot-example/src/test/kotlin/com/example/CoroutinesApplicationTests.kt diff --git a/the-white-rabbit-spring-boot-example/src/test/kotlin/com/example/CoroutinesApplicationTests.kt b/the-white-rabbit-spring-boot-example/src/test/kotlin/com/example/CoroutinesApplicationTests.kt deleted file mode 100644 index 91bb73d4..00000000 --- a/the-white-rabbit-spring-boot-example/src/test/kotlin/com/example/CoroutinesApplicationTests.kt +++ /dev/null @@ -1,23 +0,0 @@ -package com.example - - -import org.junit.jupiter.api.Test -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.context.SpringBootTest -import org.springframework.http.MediaType -import org.springframework.test.web.reactive.server.WebTestClient - -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) -class CoroutinesApplicationTests(@Autowired val client: WebTestClient) { - - @Test - fun pull() { - client.get().uri("/pull").accept(MediaType.APPLICATION_JSON).exchange().expectStatus().is2xxSuccessful.expectBody() - } - - @Test - fun push() { - client.get().uri("/push").accept(MediaType.APPLICATION_JSON).exchange().expectStatus().is2xxSuccessful.expectBody() - } - -}