com.workflowfm.proter.metrics

Type members

Classlikes

Helper to write stuff to a file.

Helper to write stuff to a file.

Todo

Move somewhere else as a utility?

case
class ResourceMetrics(name: String, costPerTick: Double, idleUpdate: Long, busyTime: Long, idleTime: Long, tasks: Int, cost: Double)

Metrics for at TaskResource.

Metrics for at TaskResource.

Value Params
busyTime

the total amount of virtual time that the TaskResource has been busy, i.e. attached to a TaskInstance

cost

the total cost associated with this TaskResource

idleTime

the total amount of virtual time that the TaskResource has been idle, i.e. not attached to any TaskInstance

name

the unique name of the TaskResource

tasks

the number of different TaskInstances that have been attached to this TaskResource

Companion
object
Companion
class
class SimCSVFileOutput(path: String, name: String) extends SimMetricsStringOutput with FileOutput

Outputs simulation metrics to files using a standard CSV format. Generates 3 CSV files,

Outputs simulation metrics to files using a standard CSV format. Generates 3 CSV files,

  1. One for tasks with a "-tasks.csv" suffix,
  2. One for simulations with a "-simulations.csv" suffix.
  3. One for resources with a "-resources.csv" suffix.
Value Params
name

file name prefix

path

path to directory where the files will be placed

class SimD3Timeline(path: String, file: String, tick: Int) extends SimMetricsOutput with FileOutput

Outputs simulation metrics to a file using the d3-timeline format. Generates 1 file with a "-simdata.js" suffix. This can then be combined with the resources at https://github.com/PetrosPapapa/WorkflowFM-PEW/tree/master/resources/d3-timeline to render the timeline in a browser.

Outputs simulation metrics to a file using the d3-timeline format. Generates 1 file with a "-simdata.js" suffix. This can then be combined with the resources at https://github.com/PetrosPapapa/WorkflowFM-PEW/tree/master/resources/d3-timeline to render the timeline in a browser.

The timeline can display either virtual units of time or millisecond durations. If we choose the latter, we can provide the size of the virtual unit of time in milliseconds and all the durations will be scaled to that. For example, if our virtual unit of time is minutes, we need to provide a tick value of 60000.

Value Params
file

file name prefix

path

path to directory where the files will be placed

tick

the size of 1 unit of virtual time

class SimMetricsHandler(output: SimMetricsOutput) extends ResultHandler[SimMetricsAggregator]

A ResultHandler that collects simulation metrics to a SimMetricsAggregator.

A ResultHandler that collects simulation metrics to a SimMetricsAggregator.

Returns the SimMetricsAggregator with all the data as a result when done.

Outputs the result using an (optional) SimMetricsOutput.

Value Params
output

The SimMetricsOutput to use, if any.

trait SimMetricsOutput extends (Long, SimMetricsAggregator) => Unit

Manipulates a SimMetricsAggregator to produce some output via side-effects.

Manipulates a SimMetricsAggregator to produce some output via side-effects.

As a function, takes 2 arguments:

  • a scala.Long representing the total virtual time elapsed
  • the SimMetricsAggregator to act upon
Companion
object

Contains helpful formatting shortcut functions.

Contains helpful formatting shortcut functions.

Companion
class
case
class SimMetricsOutputs(handlers: Queue[SimMetricsOutput]) extends SimMetricsOutput

A SimMetricsOutput consisting of a Queue of SimMetricsOutputs to be run sequentially.

A SimMetricsOutput consisting of a Queue of SimMetricsOutputs to be run sequentially.

Companion
object
Companion
class

Prints all simulation metrics to standard output.

Prints all simulation metrics to standard output.

Generates a string representation of the metrics using a generalized CSV format.

Generates a string representation of the metrics using a generalized CSV format.

A SimMetricsOutput that does nothing.

A SimMetricsOutput that does nothing.

case
class SimulationMetrics(name: String, started: Long, duration: Long, delay: Long, tasks: Int, cost: Double, result: Option[String])

Metrics for a simulation that has already started.

Metrics for a simulation that has already started.

Value Params
cost

the total cost associated with the simulation so far

delay

the sum of all delays for all involved TaskInstances

duration

the virtual duration of the simulation

name

the unique name of the simulation

result

a String representation of the returned result from the simulation, or scala.None if it still running. In case of failure, the field is populated with the localized message of the exception thrown

started

the virtual timestamp when the simulation started executing

tasks

the number of TaskInstances associated with the simulation so far

Companion
object
Companion
class
case
class TaskMetrics(id: UUID, task: String, simulation: String, priority: Int, created: Long, started: Option[Long], duration: Long, cost: Double, resources: Seq[String], aborted: Boolean)

Metrics for a simulated TaskInstance that consumed virtual time.

Metrics for a simulated TaskInstance that consumed virtual time.

Value Params
cost

the cost associated with the TaskInstance

created

the virtual timestamp when the TaskInstance was created and entered the Coordinator

duration

the virtual duration of the TaskInstance

id

the unique ID of the TaskInstance

priority

the priority of the TaskInstance

resources

the list of names of the TaskResources this TaskInstance used

simulation

the name of the simulation the TaskInstance belongs to

started

the virtual timestamp when the TaskInstance started executing, or scala.None if it has not started yet

task

the name of the TaskInstance

Companion
object
Companion
class