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.
- Alphabetic
- By Inheritance
- MetricsHandler
- PiEventHandler
- Function1
- MetricsAggregator
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
MetricsHandler(timeFn: Key[Long] = PiMetadata.SystemTime)
- timeFn
the PiMetadata key to retrieve timing information (the recorder system time by default)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
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
-
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
-
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
-
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()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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
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)
Example: -
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
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 reference2
as follows:metricsAggregator ^ (5,2,myUpdate)
Example: -
def
and(h: PiEventHandler[KeyT]): MultiPiEventHandler[KeyT]
Compose with another handler.
Compose with another handler.
- Definition Classes
- PiEventHandler
-
def
andThen[A](g: (Boolean) ⇒ A): (PiEvent[KeyT]) ⇒ A
- Definition Classes
- Function1
- Annotations
- @unspecialized()
-
def
apply(e: PiEvent[KeyT]): Boolean
Converts PiEvents to metrics updates.
Converts PiEvents to metrics updates.
- Definition Classes
- MetricsHandler → Function1
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
compose[A](g: (A) ⇒ PiEvent[KeyT]): (A) ⇒ Boolean
- Definition Classes
- Function1
- Annotations
- @unspecialized()
-
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
-
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
-
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
-
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
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
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()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Function1 → AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
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
-
val
workflowMap: Map[KeyT, WorkflowMetrics[KeyT]]
Workflow metrics indexed by workflow ID
Workflow metrics indexed by workflow ID
- Definition Classes
- MetricsAggregator
-
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
-
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
-
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
-
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