SamplingEventTrigger
A trigger that triggers when a measurement of measureType is collected.
For example, if measureType is CamsDataTypes.COMPLETED_APP_TASK, the triggerCondition can be a CompletedAppTask with a specific CompletedTask.taskName, to trigger when that task is done. Unlike ConditionalSamplingEventTrigger, it can be serialized to JSON.
- Inheritance
-
- Object
- Serializable
- TriggerConfiguration
- SamplingEventTrigger
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
SamplingEventTrigger.fromJson
SamplingEventTrigger
Creates a trigger that triggers when a measure of measureType is collected, and checks the triggerCondition to determine if it should trigger.
Properties
fromJsonFunction
The function which can convert a JSON string to an object of this type.
measureType
The data type of the event to look for.
If triggerCondition is null, sampling will be triggered for all events of this type.
triggerCondition
The specific sampling value to compare with for triggering this trigger.
When comparing, the Data.equivalentTo method is used. Hence, the sampled data must be "equivalent" to this triggerCondition in order to trigger based on an event. Note that the equivalentTo method must be overridden in application-specific Data classes to support this.
If triggerCondition is null, sampling will be triggered on every sampling event that matches the specified measureType.
Methods
toJson
Return a JSON encoding of this object.