Loupe - Log - Monitor - Resolve
Gibraltar.Agent.Metrics Namespace / EventMetric Class / Register Method / Register(EventMetricDefinition,String) Method
The metric definition for the desired metric instance.
The desired instance name (may be null for the default instance).

In This Topic
    Register(EventMetricDefinition,String) Method
    In This Topic
    Return a registered event metric instance for the provided event metric definition.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function Register( _
       ByVal definition As EventMetricDefinition, _
       ByVal instanceName As String _
    ) As EventMetric

    Parameters

    definition
    The metric definition for the desired metric instance.
    instanceName
    The desired instance name (may be null for the default instance).

    Return Value

    The EventMetric object for the requested event metric instance.
    Remarks

    If the provided event metric definition is an unregistered raw definition, it will be registered as a completed definition (or a matching registered event metric definition will be used in place of it), but an inability to successfully register the definition will result in an ArgumentException, as with calling the Register() method in EventMetricDefinition. Using a properly-registered definition is preferred.

    If an event metric with that instance name already exists for that registered definition, it will be returned. Otherwise, one will be created from that definition and returned.

    Example
    See the EventMetric Class Overview for an example.
    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