Loupe - Log - Monitor - Resolve
Gibraltar.Agent.Metrics Namespace / EventMetric Class / CreateSample() Method

In This Topic
    CreateSample() Method
    In This Topic
    Create a new, empty metric sample for this event metric instance, ready to be filled out and written.
    Syntax
    'Declaration
     
    
    Public Function CreateSample() As EventMetricSample
    public EventMetricSample CreateSample()

    Return Value

    The new metric sample object.
    Remarks

    This creates an empty sample for the current event metric instance, which needs to be filled out and written. Set the value columns by calling newSample.SetValue(...), and write it to the Loupe log by calling newSample.Write().

    To record samples for event metrics defined via attributes, call eventMetricInstance.WriteSample(userDataObject) or EventMetric.Write(userDataObject).

    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