Chat Support
Loupe - Log - Monitor - Resolve
Gibraltar.Agent.Metrics Namespace / EventMetricAttribute Class
Members

In This Topic
    EventMetricAttribute Class
    In This Topic
    Define an event metric with value columns from the members of the current object.
    Syntax
    'Declaration
     
    
    <AttributeUsageAttribute(AttributeTargets.Class Or  _
        AttributeTargets.Interface Or  _
        AttributeTargets.Struct, 
       AllowMultiple=False, 
       Inherited=False)>
    <SerializableAttribute()>
    Public NotInheritable Class EventMetricAttribute 
       Inherits System.Attribute
    [AttributeUsage(AttributeTargets.Class | 
        AttributeTargets.Interface | 
        AttributeTargets.Struct, 
       AllowMultiple=false, 
       Inherited=false)]
    [Serializable()]
    public sealed class EventMetricAttribute : System.Attribute 
    Remarks

    An object (class, struct, or interface) can be decorated with this attribute to define an event metric for it. Use the EventMetricValue attribute to designate which direct members (properties, fields, or zero-argument methods) should be stored as value columns each time the event metric is sampled. The EventMetricInstanceName attribute can optionally be used on a member (typically not one also chosen as a value column, but it is allowed to be) to designate that member to automatically provide the instance name when sampling the object for this defined event metric.

    Only one event metric (containing any number of value columns) can be defined on a specific class, struct, or interface. However, using interfaces to define event metrics can allow a single object to support multiple event metric types through those separate interfaces. Such advanced tricks may require selection of a specific event metric definition by type (e.g. by typeof a particular interface) in order to sample each possible event metric as desired for that object. Selection of a definition by a specific type may also be required when sampling an inheritor object, to ensure the desired event metric is identified and sampled as appropriate, because multiple event metrics defined on a complex object can not be assumed to all be appropriate to sample every time.

    Inheritance Hierarchy

    System.Object
       System.Attribute
          Gibraltar.Agent.Metrics.EventMetricAttribute

    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