Class/Object

com.ccadllc.cedi.dtrace

Evaluator

Related Docs: object Evaluator | package dtrace

Permalink

class Evaluator[A] extends AnyRef

Provides the hooks by which the result of a effectful program can be converted into a FailureDetail for use in determining whether the program has failed for the purposes of the trace and how to render that failure. If the traced program fails, the exceptionToFailure function is used to determine if this failure should be recorded as such for the span and if the program itself is successful, while the resultToFailure function is used to determine if there is an application level failure embedded in the result and if so, how it should be rendered.

The default evaluator for a span, if a custom one is not specified, is to treat a failures and successes at the effectful program-level as such for the span, converting the Throwable to a string with the stack trace.

Source
Evaluator.scala
Linear Supertypes
AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Evaluator
  2. AnyRef
  3. Any
Implicitly
  1. by TraceEnrichedEffect
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Evaluator(exceptionToFailure: (Throwable) ⇒ Option[FailureDetail], resultToFailure: (A) ⇒ Option[FailureDetail])

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Evaluator[A] to any2stringadd[Evaluator[A]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Evaluator[A], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Evaluator[A] to ArrowAssoc[Evaluator[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  8. def ensuring(cond: (Evaluator[A]) ⇒ Boolean, msg: ⇒ Any): Evaluator[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Evaluator[A] to Ensuring[Evaluator[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (Evaluator[A]) ⇒ Boolean): Evaluator[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Evaluator[A] to Ensuring[Evaluator[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ Any): Evaluator[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Evaluator[A] to Ensuring[Evaluator[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): Evaluator[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Evaluator[A] to Ensuring[Evaluator[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. val exceptionToFailure: (Throwable) ⇒ Option[FailureDetail]

    Permalink
  15. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Evaluator[A] to StringFormat[Evaluator[A]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  18. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    AnyRef
  20. def newAnnotatedSpan(spanName: Name, evaluator: Evaluator[A], notes: Note*)(resultAnnotator: PartialFunction[Either[Throwable, A], Vector[Note]])(implicit F: Sync[Evaluator]): TraceT[Evaluator, A]

    Permalink

    Creates a new child Span in the TraceT[F, A] created by lifting this F[A], providing the capability of annotating the span with notes based on the execution result of the F[A], using the a custom Evaluator to determine success/failure of the F[A] for the purposes of recording.

    Creates a new child Span in the TraceT[F, A] created by lifting this F[A], providing the capability of annotating the span with notes based on the execution result of the F[A], using the a custom Evaluator to determine success/failure of the F[A] for the purposes of recording. For example:

    val io = IO(some computation)
    io.newAnnotatedSpan(
      Span.Name("query-products-for-sale",
      Note.string("sale-date", date.toString), Note.double("sale-max-price", 80.50)
    ) {
      case Right(saleProducts) => Vector(Note.string("sale-products", saleProducts.mkString(",")))
    }
    spanName

    - a descriptive name, emitted when the span is recorded.

    notes

    - one or more Notes which annotate the span (often the input parameters to the F[A] execution).

    returns

    newTraceT - a new instance of TraceT representing a child span.

    Implicit information
    This member is added by an implicit conversion from Evaluator[A] to TraceEnrichedEffect[Evaluator, A] performed by method TraceEnrichedEffect in com.ccadllc.cedi.dtrace.
    Definition Classes
    TraceEnrichedEffect
  21. def newAnnotatedSpan(spanName: Name, notes: Note*)(resultAnnotator: PartialFunction[Either[Throwable, A], Vector[Note]])(implicit F: Sync[Evaluator]): TraceT[Evaluator, A]

    Permalink

    Creates a new child Span in the TraceT[F, A] created by lifting this F[A], providing the capability of annotating the span with notes based on the execution result of the F[A], using the default Evaluator to determine success/failure of the F[A] for the purposes of span recording.

    Creates a new child Span in the TraceT[F, A] created by lifting this F[A], providing the capability of annotating the span with notes based on the execution result of the F[A], using the default Evaluator to determine success/failure of the F[A] for the purposes of span recording. For example:

    val io = IO(some computation)
    io.newAnnotatedSpan(
      Span.Name("query-products-for-sale",
      Note.string("sale-date", date.toString), Note.double("sale-max-price", 80.50)
    ) {
      case Right(saleProducts) => Vector(Note.string("sale-products", saleProducts.mkString(",")))
    }
    spanName

    - a descriptive name, emitted when the span is recorded.

    notes

    - one or more Notes which annotate the span (often the input parameters to the F[A] execution).

    returns

    newTraceT - a new instance of TraceT representing a child span.

    Implicit information
    This member is added by an implicit conversion from Evaluator[A] to TraceEnrichedEffect[Evaluator, A] performed by method TraceEnrichedEffect in com.ccadllc.cedi.dtrace.
    Definition Classes
    TraceEnrichedEffect
  22. def newSpan(spanName: Name, evaluator: Evaluator[A], notes: Note*)(implicit F: Sync[Evaluator]): TraceT[Evaluator, A]

    Permalink

    Creates a new child Span in the TraceT[F, A] created by lifting this F[A], providing for custom evaluation and rendering of the underlying F[A] when recording the Span.

    Creates a new child Span in the TraceT[F, A] created by lifting this F[A], providing for custom evaluation and rendering of the underlying F[A] when recording the Span. For example:

    val io = IO(some computation)
    io.newSpan(
      Span.Name("query-products-for-sale",
      Evaluator.resultToFailure[Vector[Product]
      Note.string("sale-date", date.toString), Note.double("sale-max-price", 80.50)
    )
    spanName

    - a descriptive name, emitted when the span is recorded.

    evaluator

    - an Evaluator which converts either a Throwable or A to an optional FailureDetail.

    notes

    - one or more Notes which annotate the span (often the input parameters to the F[A] execution).

    returns

    newTraceT - a new instance of TraceT representing a child span.

    Implicit information
    This member is added by an implicit conversion from Evaluator[A] to TraceEnrichedEffect[Evaluator, A] performed by method TraceEnrichedEffect in com.ccadllc.cedi.dtrace.
    Definition Classes
    TraceEnrichedEffect
  23. def newSpan(spanName: Name, notes: Note*)(implicit F: Sync[Evaluator]): TraceT[Evaluator, A]

    Permalink

    Creates a new child Span in the TraceT[F, A] created by lifting this F[A], using the default Evaluator to determine success/failure of the F[A] for the purposes of span recording.

    Creates a new child Span in the TraceT[F, A] created by lifting this F[A], using the default Evaluator to determine success/failure of the F[A] for the purposes of span recording. For example:

    val io = IO(some computation)
    io.newSpan(
      Span.Name("query-products-for-sale",
      Note.string("sale-date", date.toString), Note.double("sale-max-price", 80.50)
    )
    spanName

    - a descriptive name, emitted when the span is recorded.

    notes

    - one or more Notes which annotate the span (often the input parameters to the F[A] execution).

    returns

    a new instance of TraceT representing a child span.

    Implicit information
    This member is added by an implicit conversion from Evaluator[A] to TraceEnrichedEffect[Evaluator, A] performed by method TraceEnrichedEffect in com.ccadllc.cedi.dtrace.
    Definition Classes
    TraceEnrichedEffect
  24. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  25. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  26. val resultToFailure: (A) ⇒ Option[FailureDetail]

    Permalink
  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  28. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  29. def toTraceT: TraceT[Evaluator, A]

    Permalink

    Lifts this program F which computes A into a TraceT[F, A] context.

    Lifts this program F which computes A into a TraceT[F, A] context.

    returns

    traceTOfA - a TraceT[F, A]

    Implicit information
    This member is added by an implicit conversion from Evaluator[A] to TraceEnrichedEffect[Evaluator, A] performed by method TraceEnrichedEffect in com.ccadllc.cedi.dtrace.
    Definition Classes
    TraceEnrichedEffect
  30. final def wait(arg0: Long, arg1: Int): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. def [B](y: B): (Evaluator[A], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Evaluator[A] to ArrowAssoc[Evaluator[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Deprecated Value Members

  1. def bestEffortOnFinish(f: (Option[Throwable]) ⇒ Evaluator[Unit])(implicit F: MonadError[Evaluator, Throwable]): Evaluator[A]

    Permalink

    Lifts this F[A] into a TraceT[F, A] and then transforms that TraceT to an equivalent TraceT[F, A] where the passed-in function will be executed at the finish of the underlying effectful program.

    Lifts this F[A] into a TraceT[F, A] and then transforms that TraceT to an equivalent TraceT[F, A] where the passed-in function will be executed at the finish of the underlying effectful program.

    f

    - a function which is passed an optional Throwable - defined if the program failed and returns a TraceT[F, Unit], a program run only for its effect.

    returns

    a new TraceT[F, A] with the error handling of the aforementioned f function parameter.

    Implicit information
    This member is added by an implicit conversion from Evaluator[A] to TraceEnrichedEffect[Evaluator, A] performed by method TraceEnrichedEffect in com.ccadllc.cedi.dtrace.
    Definition Classes
    TraceEnrichedEffect
    Annotations
    @deprecated
    Deprecated

    (Since version 1.5.0) use guaranteeCase on effect

  2. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion TraceEnrichedEffect from Evaluator[A] to TraceEnrichedEffect[Evaluator, A]

Inherited by implicit conversion any2stringadd from Evaluator[A] to any2stringadd[Evaluator[A]]

Inherited by implicit conversion StringFormat from Evaluator[A] to StringFormat[Evaluator[A]]

Inherited by implicit conversion Ensuring from Evaluator[A] to Ensuring[Evaluator[A]]

Inherited by implicit conversion ArrowAssoc from Evaluator[A] to ArrowAssoc[Evaluator[A]]

Ungrouped