Chat Support
Loupe - Log - Monitor - Resolve
Gibraltar.Agent.Metrics Namespace / SampledMetric Class / Register Method / Register(String,String,String,SamplingType,String,String,String,String) Method
The metrics capture system label.
The name of the category with which this metric is associated.
The name of the metric definition within the category.
The sampling type of this sampled metric counter.
A displayable caption for the units this metric samples, or null for unit-less values.
A displayable caption for this sampled metric counter.
An extended end-user description of this sampled metric counter.
The unique name of this instance within the metric's collection (may be null).

In This Topic
    Register(String,String,String,SamplingType,String,String,String,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 Register( _
       ByVal metricsSystem As String, _
       ByVal categoryName As String, _
       ByVal counterName As String, _
       ByVal samplingType As SamplingType, _
       ByVal unitCaption As String, _
       ByVal metricCaption As String, _
       ByVal description As String, _
       ByVal instanceName As String _
    ) As SampledMetric

    Parameters

    metricsSystem
    The metrics capture system label.
    categoryName
    The name of the category with which this metric is associated.
    counterName
    The name of the metric definition within the category.
    samplingType
    The sampling type of this sampled metric counter.
    unitCaption
    A displayable caption for the units this metric samples, or null for unit-less values.
    metricCaption
    A displayable caption for this sampled metric counter.
    description
    An extended end-user description of this sampled metric counter.
    instanceName
    The unique name of this instance within the metric's collection (may be null).
    Remarks

    This call is designed to be safe in multithreaded environments. If two threads attempt to register the same metric at the same time, the first will register the metric and the second (and all subsequent calls to Register with the same three part key) will return the same object.

    If the Metric Definition doesn't exist, it will be created. If the Sampled Metric doesn't exist, it will be created.

    If a metric definition does exist with the same 3-part Key but is not a sampled metric an exception will be thrown. This is one of the only times that an exception can be thrown by the Loupe Agent.

    Example
    For examples, see the Sampled Metric class overview.
    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