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
| It doesn’t matter if you are from JVM, .Net, PHP or else-world. If you need to test the performance - it will be a challenging task, especially nowadays with microservices architectures, clusters and very complex systems. I would like to address the most common pitfalls in this area. Share my experience gained through demanding experiments and quite often frustrating failures. Although most of the examples come from the JVM world, the aim of this presentation is to show some universal problems, laws and best practices that rule this very specific kind of testing. |
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
| val eventJournal = PersistenceQuery(system).readJournalFor[CassandraReadJournal](CassandraReadJournal.Identifier) | |
| eventJournal | |
| .eventsByPersistenceId(persistenceId, startingSequenceNr, Long.MaxValue) | |
| .map { | |
| case EventEnvelope(_, _, sequenceNr, event: DomainEvent) => { | |
| (sequenceNr, event) | |
| } | |
| } | |
| .via(sendEventToKafka) |
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
| Value Percentile TotalCount 1/(1-Percentile) | |
| 0 0.000000000000 970 1.00 | |
| 63 0.500000000000 64196 2.00 | |
| 127 0.750000000000 100000 4.00 | |
| 127 0.875000000000 100000 8.00 | |
| 127 0.937500000000 100000 16.00 | |
| 127 0.968750000000 100000 32.00 | |
| 127 0.984375000000 100000 64.00 | |
| 127 0.992187500000 100000 128.00 | |
| 127 0.996093750000 100000 256.00 |
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
| def printHdrHistogram(times: Seq[Int]) = { | |
| val histogram = new Histogram(1000000, 0) | |
| times.map(time => histogram.recordValue(time)) | |
| histogram.outputPercentileDistribution(System.out, 1, 1.0) | |
| } |
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
| -----------1 | |
| 75: 75.000000 | |
| 95: 95.000000 | |
| 99: 98.000000 | |
| 99.9: 1000.000000 | |
| max: 1000 | |
| -----------2 | |
| 75: 75.000000 | |
| 95: 94.000000 | |
| 99: 98.000000 |
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
| object DropWizardTest extends App { | |
| val random = Random | |
| val times = | |
| //normal behavior | |
| (1 to 100000).map(_ => random.nextInt(100)) ++ | |
| //standard peacks | |
| (1 to 100).map(_ => 1000) ++ | |
| //very high peacks | |
| (1 to 10).map(_ => 10000) |
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
| Source(1 to 10) | |
| .map(_ / 0) | |
| .runWith(Sink.ignore) |
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
| Source(1 to 10) | |
| .flatMapConcat { i => | |
| Source.single(i) | |
| .map(toKafkaRecord) | |
| .via(Producer.flow(producerSettings)) | |
| } | |
| .runForeach(i => println(s"${i.message.passThrough} sent to kafka")) |
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
| Source(1 to 10) | |
| .map(toKafkaRecord) | |
| .via(Producer.flow(producerSettings)) | |
| .runForeach(i => println(s"${i.message.passThrough} sent to kafka")) |
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
| Source(1 to 10) | |
| .via(nonLinearFlow) | |
| .collect { | |
| case (Success(a), Success(b)) => (a, b) | |
| } | |
| .runForeach(println) |