Loupe - Log - Monitor - Resolve
Gibraltar.Agent.Metrics Namespace / EventMetricDefinition Class / Write Method / Write(Object,String) Method
A user data object defining event metrics by attributes on itself or its interfaces or any inherited type.
The instance name to fall back on if a given definition does not specify an instance name binding (may be null).

In This Topic
    Write(Object,String) Method
    In This Topic
    Sample every event metric defined by EventMetric and EventMetricValue attributes on the provided data object at any interface or inheritance level.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Sub Write( _
       ByVal metricData As Object, _
       ByVal fallbackInstanceName As String _
    ) 
    public static void Write( 
       object metricData,
       string fallbackInstanceName
    )

    Parameters

    metricData
    A user data object defining event metrics by attributes on itself or its interfaces or any inherited type.
    fallbackInstanceName
    The instance name to fall back on if a given definition does not specify an instance name binding (may be null).
    Exceptions
    ExceptionDescription
    The specified metricDataObjectType does not have an EventMetric attribute

    -or-

    The specified Type does not have a usable EventMetric attribute, so it can't be used to define an event metric.

    -or-

    The specified Type's EventMetric has an empty metric namespace which is not allowed, so no metric can be defined.

    -or-

    The specified Type's EventMetric has an empty metric category name which is not allowed, so no metric can be defined.

    -or-

    The specified Type's EventMetric has an empty metric counter name which is not allowed, so no metric can be defined.

    -or-

    The specified Type's EventMetric attribute's 3-part Key is already used for a metric definition which is not an event metric.
    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