docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class CounterEvent

    An EventBase that tracks discrete call counts per named function over time.

    Inheritance
    object
    EventBase
    CounterEvent
    Inherited Members
    EventBase.dispatchDelegate
    EventBase.collector
    EventBase.eventName
    EventBase.allowMultipledEventsOfType
    EventBase.resetOnEachSampleCollection
    EventBase.IsMultipleEventsInstancesAllowed()
    EventBase.Reset()
    EventBase.Update(float)
    EventBase._elapsedInterval
    EventBase._elapsedPeriod
    EventBase._interval
    EventBase._period
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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.

    Overrides
    EventBase.IngestValue(double)
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)