c

com.workflowfm.pew.metrics

MetricsHandler

class MetricsHandler[KeyT] extends MetricsAggregator[KeyT] with PiEventHandler[KeyT]

A MetricsAggregator that is also a com.workflowfm.pew.stream.PiEventHandler. Aggregates metrics automatically based on PiEvents and system time.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MetricsHandler
  2. PiEventHandler
  3. Function1
  4. MetricsAggregator
  5. AnyRef
  6. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MetricsHandler(timeFn: Key[Long] = PiMetadata.SystemTime)

    timeFn

    the PiMetadata key to retrieve timing information (the recorder system time by default)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from MetricsHandler[KeyT] to any2stringadd[MetricsHandler[KeyT]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def +=(m: WorkflowMetrics[KeyT]): Map[KeyT, WorkflowMetrics[KeyT]]

    Adds a new WorkflowMetrics instance, taking care of indexing automatically Overwrites a previous instance with the same ID

    Adds a new WorkflowMetrics instance, taking care of indexing automatically Overwrites a previous instance with the same ID

    Definition Classes
    MetricsAggregator
  5. def +=(m: ProcessMetrics[KeyT]): Map[KeyT, Map[Int, ProcessMetrics[KeyT]]]

    Adds a new ProcessMetrics instance, taking care of indexing automatically Overwrites a previous instance with the same IDs

    Adds a new ProcessMetrics instance, taking care of indexing automatically Overwrites a previous instance with the same IDs

    Definition Classes
    MetricsAggregator
  6. def ->[B](y: B): (MetricsHandler[KeyT], B)
    Implicit
    This member is added by an implicit conversion from MetricsHandler[KeyT] to ArrowAssoc[MetricsHandler[KeyT]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  7. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def ^(piID: KeyT, u: (WorkflowMetrics[KeyT]) ⇒ WorkflowMetrics[KeyT]): Option[Map[KeyT, WorkflowMetrics[KeyT]]]

    Updates a WorkflowMetrics instance

    Updates a WorkflowMetrics instance

    piID

    the workflow ID of the process

    u

    a function to update the ProcessMetrics instance

    returns

    the updated processMap or scala.None if the identified instance does not exist

    Definition Classes
    MetricsAggregator
    Example:
    1. Assume function that increases the number of calls WorkflowMetrics to "x":

      def myUpdate(w: WorkflowMetrics[KeyT]): WorkflowMetrics[KeyT] = w.copy(calls=calls+1)

      We can update the metrics of workflow with ID 5 as follows:

      metricsAggregator ^ (5,myUpdate)
  9. def ^(piID: KeyT, ref: Int, u: (ProcessMetrics[KeyT]) ⇒ ProcessMetrics[KeyT]): Option[Map[KeyT, Map[Int, ProcessMetrics[KeyT]]]]

    Updates a ProcessMetrics instance.

    Updates a ProcessMetrics instance.

    piID

    the workflow ID of the process

    ref

    the call reference of the process

    u

    a function to update the ProcessMetrics instance

    returns

    the updated processMap or scala.None if the identified instance does not exist

    Definition Classes
    MetricsAggregator
    Example:
    1. Assume function that updates the name of a process in ProcessMetrics to "x":

      def myUpdate(p: ProcessMetrics[KeyT]): ProcessMetrics[KeyT] = p.copy(process="x")

      We can update the metrics of process with workflow ID 5 and call reference 2 as follows:

      metricsAggregator ^ (5,2,myUpdate)
  10. def and(h: PiEventHandler[KeyT]): MultiPiEventHandler[KeyT]

    Compose with another handler.

    Compose with another handler.

    Definition Classes
    PiEventHandler
  11. def andThen[A](g: (Boolean) ⇒ A): (PiEvent[KeyT]) ⇒ A
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  12. def apply(e: PiEvent[KeyT]): Boolean

    Converts PiEvents to metrics updates.

    Converts PiEvents to metrics updates.

    Definition Classes
    MetricsHandler → Function1
  13. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  14. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  15. def compose[A](g: (A) ⇒ PiEvent[KeyT]): (A) ⇒ Boolean
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  16. def ensuring(cond: (MetricsHandler[KeyT]) ⇒ Boolean, msg: ⇒ Any): MetricsHandler[KeyT]
    Implicit
    This member is added by an implicit conversion from MetricsHandler[KeyT] to Ensuring[MetricsHandler[KeyT]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: (MetricsHandler[KeyT]) ⇒ Boolean): MetricsHandler[KeyT]
    Implicit
    This member is added by an implicit conversion from MetricsHandler[KeyT] to Ensuring[MetricsHandler[KeyT]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: Boolean, msg: ⇒ Any): MetricsHandler[KeyT]
    Implicit
    This member is added by an implicit conversion from MetricsHandler[KeyT] to Ensuring[MetricsHandler[KeyT]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. def ensuring(cond: Boolean): MetricsHandler[KeyT]
    Implicit
    This member is added by an implicit conversion from MetricsHandler[KeyT] to Ensuring[MetricsHandler[KeyT]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  22. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  23. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from MetricsHandler[KeyT] to StringFormat[MetricsHandler[KeyT]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  24. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  25. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  27. def keys: Iterable[KeyT]

    Returns the collection of workflow IDs that have been tracked.

    Returns the collection of workflow IDs that have been tracked.

    Definition Classes
    MetricsAggregator
  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. def procCall(piID: KeyT, ref: Int, process: String, time: Long): Unit

    Handles the event of an atomic process call, updating its metrics accordingly.

    Handles the event of an atomic process call, updating its metrics accordingly.

    piID

    the ID of the workflow

    ref

    the call reference ID

    process

    the name of the atomic process being called

    time

    the timestamp to be recorded as the process start

    Definition Classes
    MetricsAggregator
  32. def procReturn(piID: KeyT, ref: Int, result: Any, time: Long = System.currentTimeMillis()): Unit

    Handles the event of an atomic process returning successfully, updating its metrics accordingly.

    Handles the event of an atomic process returning successfully, updating its metrics accordingly.

    piID

    the ID of the workflow

    ref

    the call reference ID

    result

    the result returned by the process

    time

    the timestamp to be recorded as the process finish

    Definition Classes
    MetricsAggregator
  33. def processException(piID: KeyT, ref: Int, ex: Throwable, time: Long = System.currentTimeMillis()): Unit

    Handles the event of an atomic process failing with an exception, updating its metrics accordingly.

    Handles the event of an atomic process failing with an exception, updating its metrics accordingly.

    piID

    the ID of the workflow

    ref

    the call reference ID

    ex

    the thrown exception (or other scala.Throwable)

    time

    the timestamp to be recorded as the process finish

    Definition Classes
    MetricsAggregator
  34. def processFailure(piID: KeyT, ref: Int, ex: String, time: Long = System.currentTimeMillis()): Unit

    Handles the event of an atomic process failing in any way, updating its metrics accordingly.

    Handles the event of an atomic process failing in any way, updating its metrics accordingly.

    piID

    the ID of the workflow

    ref

    the call reference ID

    ex

    a String explanation of what went wrong

    time

    the timestamp to be recorded as the process finish

    Definition Classes
    MetricsAggregator
  35. val processMap: Map[KeyT, Map[Int, ProcessMetrics[KeyT]]]

    Process metrics indexed by workflow ID, then by call reference ID

    Process metrics indexed by workflow ID, then by call reference ID

    Definition Classes
    MetricsAggregator
  36. def processMetrics: Seq[ProcessMetrics[KeyT]]

    Returns all the tracked instances of ProcessMetrics sorted by starting time.

    Returns all the tracked instances of ProcessMetrics sorted by starting time.

    Definition Classes
    MetricsAggregator
  37. def processMetricsOf(id: KeyT): Seq[ProcessMetrics[KeyT]]

    Returns all the tracked instances of ProcessMetrics associated with a particular workflow, sorted by starting time.

    Returns all the tracked instances of ProcessMetrics associated with a particular workflow, sorted by starting time.

    id

    the ID of the workflow

    Definition Classes
    MetricsAggregator
  38. def processSet: SortedSet[String]

    Returns a SortedSet of all process names being tracked.

    Returns a SortedSet of all process names being tracked. This is useful when using process names as a category, for example to colour code tasks in the timeline.

    Definition Classes
    MetricsAggregator
  39. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  40. def toString(): String
    Definition Classes
    Function1 → AnyRef → Any
  41. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  44. def workflowException(piID: KeyT, ex: Throwable, time: Long = System.currentTimeMillis()): Unit

    Handles the event of a workflow failing with an exception, updating its metrics accordingly.

    Handles the event of a workflow failing with an exception, updating its metrics accordingly.

    piID

    the ID of the workflow

    ex

    the thrown exception (or other scala.Throwable)

    time

    the timestamp to be recorded as the workflow finish

    Definition Classes
    MetricsAggregator
  45. val workflowMap: Map[KeyT, WorkflowMetrics[KeyT]]

    Workflow metrics indexed by workflow ID

    Workflow metrics indexed by workflow ID

    Definition Classes
    MetricsAggregator
  46. def workflowMetrics: Seq[WorkflowMetrics[KeyT]]

    Returns all the tracked instances of WorkflowMetrics sorted by starting time.

    Returns all the tracked instances of WorkflowMetrics sorted by starting time.

    Definition Classes
    MetricsAggregator
  47. def workflowResult(piID: KeyT, result: Any, time: Long = System.currentTimeMillis()): Unit

    Handles the event of a workflow finishing successfully, updating its metrics accordingly.

    Handles the event of a workflow finishing successfully, updating its metrics accordingly.

    piID

    the ID of the workflow

    result

    the return value of the workflow

    time

    the timestamp to be recorded as the workflow finish

    Definition Classes
    MetricsAggregator
  48. def workflowStart(piID: KeyT, time: Long): Unit

    Handles the event of a workflow starting, updating its metrics accordingly.

    Handles the event of a workflow starting, updating its metrics accordingly.

    piID

    the ID of the workflow

    time

    the timestamp to be recorded as the workflow start

    Definition Classes
    MetricsAggregator
  49. def [B](y: B): (MetricsHandler[KeyT], B)
    Implicit
    This member is added by an implicit conversion from MetricsHandler[KeyT] to ArrowAssoc[MetricsHandler[KeyT]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from PiEventHandler[KeyT]

Inherited from (PiEvent[KeyT]) ⇒ Boolean

Inherited from MetricsAggregator[KeyT]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from MetricsHandler[KeyT] to any2stringadd[MetricsHandler[KeyT]]

Inherited by implicit conversion StringFormat from MetricsHandler[KeyT] to StringFormat[MetricsHandler[KeyT]]

Inherited by implicit conversion Ensuring from MetricsHandler[KeyT] to Ensuring[MetricsHandler[KeyT]]

Inherited by implicit conversion ArrowAssoc from MetricsHandler[KeyT] to ArrowAssoc[MetricsHandler[KeyT]]

Ungrouped