Loupe - Log - Monitor - Resolve
Gibraltar.Agent.Metrics Namespace / SampledMetric Class / Register Method / Register(SampledMetricDefinition,String) Method
The metric definition for the metric instance.
The unique name of this instance within the metric's collection (may be null).

In This Topic
    Register(SampledMetricDefinition,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 definition As SampledMetricDefinition, _
       ByVal instanceName As String _
    ) As SampledMetric

    Parameters

    definition
    The metric definition for the metric instance.
    instanceName
    The unique name of this instance within the metric's collection (may be null).

    Return Value

    The event metric object for the specified event metric instance.
    Remarks

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

    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.

    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