Class JournalPerfSpec

  • All Implemented Interfaces:
    CapabilityFlags, JournalCapabilityFlags, MayVerb, OptionalTests, TestKitBase, java.io.Serializable, org.scalactic.Explicitly, org.scalactic.Tolerance, org.scalactic.TripleEquals, org.scalactic.TripleEqualsSupport, org.scalatest.Alerting, org.scalatest.Assertions, org.scalatest.BeforeAndAfterAll, org.scalatest.BeforeAndAfterEach, org.scalatest.Documenting, org.scalatest.Informing, org.scalatest.matchers.dsl.MatcherWords, org.scalatest.matchers.should.Matchers, org.scalatest.Notifying, org.scalatest.Suite, org.scalatest.SuiteMixin, org.scalatest.TestRegistration, org.scalatest.TestSuite, org.scalatest.verbs.CanVerb, org.scalatest.verbs.MustVerb, org.scalatest.verbs.ShouldVerb, org.scalatest.wordspec.AnyWordSpecLike
    Direct Known Subclasses:
    JavaJournalPerfSpec

    public abstract class JournalPerfSpec
    extends JournalSpec
    This spec measures execution times of the basic operations that an PersistentActor provides, using the provided Journal (plugin).

    It is *NOT* meant to be a comprehensive benchmark, but rather aims to help plugin developers to easily determine if their plugin's performance is roughly as expected. It also validates the plugin still works under "more messages" scenarios.

    In case your journal plugin needs some kind of setup or teardown, override the beforeAll or afterAll methods (don't forget to call super in your overridden methods).

    For a Java and JUnit consumable version of the TCK please refer to JavaJournalPerfSpec.

    See Also:
    JournalSpec, Serialized Form
    • Constructor Detail

      • JournalPerfSpec

        public JournalPerfSpec​(com.typesafe.config.Config config)
    • Method Detail

      • benchActor

        public ActorRef benchActor​(int replyAfter)
      • feedAndExpectLast

        public void feedAndExpectLast​(ActorRef actor,
                                      java.lang.String mode,
                                      scala.collection.immutable.Seq<java.lang.Object> cmnds)
      • measure

        public void measure​(scala.Function1<scala.concurrent.duration.Duration,​java.lang.String> msg,
                            scala.Function0<scala.runtime.BoxedUnit> block)
        Executes a block of code multiple times (no warm-up)
      • awaitDurationMillis

        public long awaitDurationMillis()
        Override in order to customize timeouts used for expectMsg, in order to tune the awaits to your journal's perf
      • eventsCount

        public int eventsCount()
        Number of messages sent to the PersistentActor under test for each test iteration
      • measurementIterations

        public int measurementIterations()
        Number of measurement iterations each test will be run.