Class EventBase
Abstract base class for profiler events that collect and aggregate metrics over time.
Inherited Members
Namespace: Unity.SimulationPro
Assembly: Unity.SimulationPro.Capture.dll
Syntax
[Serializable]
public abstract class EventBase
Remarks
Subclass EventBase to define custom metric collection behavior.
Events are registered with a CollectorBase via AddEvent(EventBase).
The collector delegate is invoked at each interval to sample the metric;
the dispatchDelegate is called by ContinuousEvents at the dispatch period.
Constructors
EventBase(string, float, EventCollectionDelegate)
Constucts an Event that collects a metric each interval and aggregates over a period.
Declaration
public EventBase(string eventName, float interval, ContinuousEvents.EventCollectionDelegate collector = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | eventName | The name of the event. |
| float | interval | The interval in which to collect the metric, in seconds. |
| ContinuousEvents.EventCollectionDelegate | collector | A delegate to collect the metric. |
Fields
_elapsedInterval
The elapsed interval.
Declaration
protected float _elapsedInterval
Field Value
| Type | Description |
|---|---|
| float |
_elapsedPeriod
The elapsed period.
Declaration
protected float _elapsedPeriod
Field Value
| Type | Description |
|---|---|
| float |
_interval
The interval.
Declaration
protected float _interval
Field Value
| Type | Description |
|---|---|
| float |
_period
The period.
Declaration
protected float _period
Field Value
| Type | Description |
|---|---|
| float |
allowMultipledEventsOfType
The allowMultipledEventsOfType.
Declaration
protected bool allowMultipledEventsOfType
Field Value
| Type | Description |
|---|---|
| bool |
eventName
Name of the event.
Declaration
public string eventName
Field Value
| Type | Description |
|---|---|
| string |
resetOnEachSampleCollection
The resetOnEachSampleCollection.
Declaration
[JsonIgnore]
public bool resetOnEachSampleCollection
Field Value
| Type | Description |
|---|---|
| bool |
Properties
collector
The delegate to use for collecting a metric to aggregate.
Declaration
[JsonIgnore]
public ContinuousEvents.EventCollectionDelegate collector { get; set; }
Property Value
| Type | Description |
|---|---|
| ContinuousEvents.EventCollectionDelegate |
dispatchDelegate
The delegate to use for dispatching events.
Declaration
[JsonIgnore]
public ContinuousEvents.EventDispatchDelegate dispatchDelegate { get; set; }
Property Value
| Type | Description |
|---|---|
| ContinuousEvents.EventDispatchDelegate |
Methods
IngestValue(double)
Override this method to provide implementation for ingesting the value to perform some aggregation.
Declaration
public virtual void IngestValue(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| double | value | Value ingested from the data source. |
IsMultipleEventsInstancesAllowed()
IsMultipleEventsInstancesAllowed method.
Declaration
public bool IsMultipleEventsInstancesAllowed()
Returns
| Type | Description |
|---|---|
| bool |
|
Reset()
Implement this method to override the reset logic for the event before each sample capture.
Declaration
public virtual void Reset()
Update(float)
Update method.
Declaration
public virtual void Update(float deltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| float | deltaTime | The deltaTime. |