|Gibraltar.Agent.Metrics Namespace > EventMetric Class > Register Method : Register(EventMetricDefinition,String) Method|
'Declaration Public Overloads Shared Function Register( _ ByVal definition As EventMetricDefinition, _ ByVal instanceName As String _ ) As EventMetric
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.
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