Chat Support
Loupe - Log - Monitor - Resolve
Gibraltar.Monitor Namespace / EventMetric Class / AddOrGet Method / AddOrGet(EventMetricDefinition,String) Method
The metric definition for the metric instance
The unique name of this instance within the metric's collection.

AddOrGet(EventMetricDefinition,String) Method
Creates a new metric instance or returns an existing one from the provided definition information, or returns any existing instance if found.
Syntax
'Declaration
 
Public Overloads Shared Function AddOrGet( _
   ByVal definition As EventMetricDefinition, _
   ByVal instanceName As String _
) As EventMetric
 

Parameters

definition
The metric definition for the metric instance
instanceName
The unique name of this instance within the metric's collection.

Return Value

The event metric object for the specified event metric instance.
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 an Event 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