Class CounterEvent
An EventBase that tracks discrete call counts per named function over time.
Inherited Members
Namespace: Unity.SimulationPro
Assembly: Unity.SimulationPro.Capture.dll
Syntax
[Serializable]
public class CounterEvent : EventBase
Remarks
Use IncrementCount(string) each time a function of interest is called. The counts are accumulated in the thread-safe CounterStore dictionary.
Constructors
CounterEvent(string, float, EventCollectionDelegate)
Creates a new CounterEvent with the given name and collection interval.
Declaration
public CounterEvent(string eventName, float interval, ContinuousEvents.EventCollectionDelegate collector = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | eventName | The display name of this counter event. |
| float | interval | The interval in seconds at which the metric is sampled. |
| ContinuousEvents.EventCollectionDelegate | collector | An optional delegate to collect a numeric metric each interval. |
Fields
CounterStore
Gets the thread-safe dictionary mapping function names to their accumulated CounterEventData.
Declaration
public ConcurrentDictionary<string, CounterEventData> CounterStore
Field Value
| Type | Description |
|---|---|
| ConcurrentDictionary<string, CounterEventData> |
Methods
IncrementCount(string)
Increment the count of the function call.
Declaration
public void IncrementCount(string functionName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | functionName | The name of the function whose call count should be incremented. |
IngestValue(double)
IngestValue method.
Declaration
public override void IngestValue(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| double | value | Associated value in a key-value pair. |