Expand description

The Monitor is the single threaded version of the API. Consequently deadlines of timed streams are only evaluated with a new event. Hence this API is more suitable for offline monitoring or embedded scenarios.

The Monitor is parameterized over its input and output method. The preferred method to create an API is using the ConfigBuilder and the monitor method.

Input Method

An input method has to implement the Input trait. Out of the box two different methods are provided:

  • EventInput: Provides a basic input method for anything that already is an Event or that can be transformed into one using Into<Event>.
  • RecordInput: Is a more elaborate input method. It allows to provide a custom data structure to the monitor as an input, as long as it implements the Record trait. If implemented this traits provides functionality to generate a new value for any input stream from the data structure.

Output Method

The Monitor can provide output with a varying level of detail captured by the VerdictRepresentation trait. The different output formats are:

  • Incremental: For each processed event a condensed list of monitor state changes is provided.
  • Total: For each event a complete snapshot of the current monitor state is returned
  • TotalIncremental: For each processed event a complete list of monitor state changes is provided
  • TriggerMessages: For each event a list of violated triggers with their description is produced.
  • TriggersWithInfoValues: For each event a list of violated triggers with their specified corresponding values is returned.

Structs

The simplest input method to the monitor. It accepts any type that implements Into<Event>. The conversion to values and the order of inputs must be handled externally.
The Monitor is the central object exposed by the API.
This tracer provides no tracing data at all and serves as a default value.
A raw verdict that is transformed into the respective representation
An input method for types that implement the Record trait. Useful if you do not want to bother with the order of the input streams in an event. Assuming the specification has 3 inputs: ‘a’, ‘b’ and ‘c’. You could implement this trait for your custom ‘MyType’ as follows:
Represents a snapshot of the monitor state containing the current value of each output and input stream.
Represents the changes of the monitor state divided into inputs, outputs and trigger. Changes of output streams are represented by a set of Changes. A change of an input is represented by its new Value. A change of a trigger is represented by its formatted message.
A generic VerdictRepresentation suitable to use with any tracer.
The Verdicts struct represents the verdict of the API.

Enums

An enum representing a change in the monitor.

Traits

This trait provides the functionality to pass inputs to the monitor. You can either implement this trait for your own Datatype or use one of the predefined input methods. See RecordInput and EventInput
This trait provides functionality to parse a record into an event. It is only used in combination with the RecordInput.
Provides the functionality to collect additional tracing data during evaluation. The ‘start’ methods are guaranteed to be called before the ‘end’ method, while either both or none of them are called.
Provides the functionality to generate a snapshot of the streams values.

Type Definitions

An event to be handled by the interpreter
Represents the changes of the monitor state. Each element represents a set of Changes of a specific output stream.
A stream instance. First element represents the parameter values of the instance, the second element the value of the instance.
A type representing the parameters of a stream. If a stream is not dynamically created it defaults to None. If a stream is dynamically created but does not have parameters it defaults to Some(vec![])
Represents the index and the formatted message of all violated triggers.
Represents the index and the info values of all violated triggers.
A function Type that projects a reference to From to a Value