Chat Support
Loupe - Log - Monitor - Resolve
Loupe.Agent.PerformanceCounters Namespace / PerfCounterMetric Class / AddOrGet Method / AddOrGet(String,String,PerfCounterInstanceAlias) Method
The name of the performance counter category (performance object) with which this performance counter is associated.
The name of the performance counter.
An alias to use to determine the instance name instead of the instance of the supplied counter.

In This Topic
    AddOrGet(String,String,PerfCounterInstanceAlias) Method
    In This Topic
    Creates a new performance counter 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 categoryName As String, _
       ByVal counterName As String, _
       ByVal alias As PerfCounterInstanceAlias _
    ) As PerfCounterMetric

    Parameters

    categoryName
    The name of the performance counter category (performance object) with which this performance counter is associated.
    counterName
    The name of the performance counter.
    alias
    An alias to use to determine the instance name instead of the instance of the supplied counter.

    Return Value

    The Performance Counter Metric object for the specified 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 a Performance Counter Metric (or a derived class) an exception will be thrown.
    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