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, 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
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 bestEffortOnFinish(f: (Option[Throwable]) ⇒ Evaluator[Unit])(implicit F: Catchable[Evaluator]): Evaluator[A]

    Permalink

    Lifts this F[A] into a TraceT[F, A] and then transforms that TraceT to an equivalent TraceT[F, A] where a best-effort will be made to execute the passed-in function on the finish of the underlying effectful program. The function can't be guaranteed to run in the face of interrupts, etc. It depends on the nature of the effectful program itself.

    Lifts this F[A] into a TraceT[F, A] and then transforms that TraceT to an equivalent TraceT[F, A] where a best-effort will be made to execute the passed-in function on the finish of the underlying effectful program. The function can't be guaranteed to run in the face of interrupts, etc. It depends on the nature of the effectful program itself.

    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.

    F

    - an instance of fs2.util.Catchable[F] in implicit scope.

    returns

    traceTForFA - 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
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. 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
  10. 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
  11. 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
  12. 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
  13. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. 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()
  18. final def getClass(): Class[_]

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

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

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

    Permalink
    Definition Classes
    AnyRef
  22. def newAnnotatedSpan(spanName: Name, evaluator: Evaluator[A], notes: Note*)(resultAnnotator: PartialFunction[Either[Throwable, A], Vector[Note]])(implicit F: Catchable[Evaluator] with Suspendable[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 task = Task.delay(some computation) task.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).

    F

    - an instance of an fs2.util.Catchable[F] and fs2.util.Suspendable[F] in implicit scope.

    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 newAnnotatedSpan(spanName: Name, notes: Note*)(resultAnnotator: PartialFunction[Either[Throwable, A], Vector[Note]])(implicit F: Catchable[Evaluator] with Suspendable[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 task = Task.delay(some computation) task.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).

    F

    - an instance of an fs2.util.Catchable[F] and fs2.util.Suspendable[F] in implicit scope.

    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
  24. def newSpan(spanName: Name, evaluator: Evaluator[A], notes: Note*)(implicit F: Catchable[Evaluator] with Suspendable[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 task = Task.delay(some computation) task.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).

    F

    - an instance of an fs2.util.Catchable[F] and fs2.util.Suspendable[F] in implicit scope.

    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
  25. def newSpan(spanName: Name, notes: Note*)(implicit F: Catchable[Evaluator] with Suspendable[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 task = Task.delay(some computation) task.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).

    F

    - an instance of an fs2.util.Catchable[F] and fs2.util.Suspendable[F] in implicit scope.

    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
  26. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. val resultToFailure: (A) ⇒ Option[FailureDetail]

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  31. 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
  32. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. 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

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