com.stackmob.customcode.dev.server.sdk.simulator

ErrorSimulator

class ErrorSimulator extends AnyRef

simulates 0 or more errors with a specific frequency for each error. Example usage:

//throw ex1 once every 2 minutes
val ex1 = new Exception("ex1")
val ex1Freq = ThrowableFrequency(ex1, Frequency(1, Duration(2, TimeUnit.MINUTES)))
//throw ex2 twice every 5 seconds
val ex2 = new Exception("ex2")
val ex2Freq = ThrowableFrequency(ex2, Frequency(2, Duration(5, TimeUnit.SECONDS)))

//create the simulator
val simulator = ErrorSimulator(ex1Freq, ex2Freq)

//run a simulation
simulator.simulate {
  doStuff()
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ErrorSimulator
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ErrorSimulator(errs: Seq[ThrowableFrequency])

    errs

    the sequence of ThrowableFrequencies to run through on each simulate call

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def and(newErrs: Seq[ThrowableFrequency]): ErrorSimulator

    combine this ErrorSimulator with an additional sequence of ThrowableFrequency objects

    combine this ErrorSimulator with an additional sequence of ThrowableFrequency objects

    newErrs

    the ThrowableFrequency objects to add to the resulting ErrorSimulator

    returns

    the new ErrorSimulator

  7. def andThen(newErrSim: ErrorSimulator): ErrorSimulator

    combine this and the given ErrorSimulator to create a new one

    combine this and the given ErrorSimulator to create a new one

    newErrSim

    the new ErrorSimulator to combine with this one

    returns

    the ErrorSimulator result of combining this and the given

  8. def apply[T](op: ⇒ T): T

    execute a simulation across each of errs, in sequence order.

    execute a simulation across each of errs, in sequence order. throw the first simulated error that happens, if any

    T

    the return type of op

    op

    the operation to execute if none of errs threw. will be not be executed if any single err threw, otherwise exactly once

    returns

    the result of executing op

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. val errs: Seq[ThrowableFrequency]

    the sequence of ThrowableFrequencies to run through on each simulate call

  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  22. def toString(): String

    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped