Chat Support
Loupe - Log - Monitor - Resolve
Gibraltar.Monitor Namespace / EventMetricCollection Class / AddOrGet Method
The object to create a metric from.

In This Topic
    AddOrGet Method (EventMetricCollection)
    In This Topic
    Creates a new metric instance or returns an existing one by inspecting the provided object for EventMetricDefinition attributes.
    Syntax
    'Declaration
     
    
    Public Function AddOrGet( _
       ByVal userDataObject As Object _
    ) As EventMetric
    public EventMetric AddOrGet( 
       object userDataObject
    )

    Parameters

    userDataObject
    The object to create a metric from.

    Return Value

    The event metric object for the specified event metric instance.
    Remarks
    If the metric doesn't exist, it will be created. If the metric definition does exist, but is not an Event Metric (or a derived class) an exception will be thrown. If the metric definition isn't bound to an object type, the default metric will be returned. The provided object must not be null and must be of the type the metric definition owning this dictionary is bound to.
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also