Chat Support
Loupe - Log - Monitor - Resolve
Gibraltar.Monitor Namespace / EventMetric Class / AddOrGet Method / AddOrGet(String,String,String,String) Method
The unique metric type
The name of the category with which this definition is associated.
The name of the definition within the category.
The unique name of this instance within the metric's collection.

In This Topic
    AddOrGet(String,String,String,String) Method
    In This Topic
    Creates a new metric instance or returns an existing one from the provided definition information, or returns any existing instance if found.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function AddOrGet( _
       ByVal metricTypeName As String, _
       ByVal categoryName As String, _
       ByVal counterName As String, _
       ByVal instanceName As String _
    ) As EventMetric
    public static EventMetric AddOrGet( 
       string metricTypeName,
       string categoryName,
       string counterName,
       string instanceName
    )

    Parameters

    metricTypeName
    The unique metric type
    categoryName
    The name of the category with which this definition is associated.
    counterName
    The name of the definition within the category.
    instanceName
    The unique name of this instance within the metric's collection.

    Return Value

    The event metric object for the specified event metric instance.
    Remarks
    If the metric definition doesn't exist, it will be created. 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. Definitions are looked up and added to the active logging metrics collection (Log.Metrics)
    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