Loupe - Log - Monitor - Resolve
Gibraltar.Monitor Namespace / CustomSampledMetric Class / AddOrGet Method / AddOrGet(String,String,String,MetricSampleType,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 type of data captured for each metric under this definition.
The unique name of this instance within the metric's collection.

In This Topic
    AddOrGet(String,String,String,MetricSampleType,String) Method
    In This Topic
    Creates a new metric instance 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 metricSampleType As MetricSampleType, _
       ByVal instanceName As String _
    ) As CustomSampledMetric
    public static CustomSampledMetric AddOrGet( 
       string metricTypeName,
       string categoryName,
       string counterName,
       MetricSampleType metricSampleType,
       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.
    metricSampleType
    The type of data captured for each metric under this definition.
    instanceName
    The unique name of this instance within the metric's collection.
    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 Custom Sampled 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