AP&C API Reference
Public Member Functions | Protected Attributes | Properties | List of all members
Apac.Monitoring.MeasurementAvg Class Reference

Defines a value that is the average of several measurements. More...

Inheritance diagram for Apac.Monitoring.MeasurementAvg:
Apac.Monitoring.Measurement Apac.Monitoring.ITimeStamped Apac.Monitoring.WeightedMeasurementAvg

Public Member Functions

 MeasurementAvg (ManagedElement element, string fullSource)
 Creates a new instance for tracking averages and defaults the timestamp to the current time. More...
 
 MeasurementAvg (DateTime timestamp, ManagedElement element, string fullSource)
 Creates a new instance for tracking averages. More...
 
 MeasurementAvg (SerializationInfo info, StreamingContext context)
 
virtual void Add (decimal measurement)
 Adds another measurement to be averaged. More...
 
virtual void Add (ushort measurement)
 Adds another measurement to be averaged. More...
 
override string ToString ()
 
override void GetObjectData (SerializationInfo info, StreamingContext context)
 Populates a T:System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object. More...
 
- Public Member Functions inherited from Apac.Monitoring.Measurement
 Measurement (DateTime timestamp, ManagedElement element)
 
 Measurement (DateTime timestamp, ManagedElement element, decimal compiledValue, string fullSource)
 
void AddReading (Reading reading)
 Adds a reading. More...
 
void AddSourceMeasurement (Measurement sourceMeasurement)
 Adds a source measurement. More...
 
Reading GetReadingByName (string tagName)
 Gets the reading with tagName . More...
 
Measurement FindSourceMeasurementByTag (string tag)
 Finds a source measurement by tag. More...
 
virtual decimal GetAggregateSourceValue ()
 Provides an easy way for subclasses to define the aggregate source value, in the event that there are multiple readings. This value may not be meaningful for all measurements. More...
 
void Abort ()
 Aborts the measurement. More...
 
bool IsAborted ()
 Determines if the measurement has been aborted. More...
 
override string ToString ()
 Returns a System.String that represents this instance. More...
 
int CompareTo (object obj)
 Compares the current instance with another object of the same type. More...
 

Protected Attributes

decimal _sum = 0
 
uint _sampleCount = 0
 

Properties

override decimal CompiledValue [get]
 The current calculated average for this instance (sum/count). As measurements are added, this property value could change. More...
 
uint SampleCount [get]
 The number of samples used to create this weighted average. More...
 
- Properties inherited from Apac.Monitoring.Measurement
ManagedElement Element [get]
 
Reading[] Readings [get]
 Gives subclasses access to the list of readings. More...
 
Measurement[] SourceMeasurements [get]
 Gives subclasses access to the list of source measurements. More...
 
int ReadingCount [get]
 Gets the reading count. More...
 
int SourceMeasurementCount [get]
 Gets the source measurement count. More...
 
uint? ElementId [get]
 Gets the identifier of the element to which this measurement applied. More...
 
virtual decimal CompiledValue [get, set]
 Gets or sets the compiled value. More...
 
DateTime Timestamp [get, set]
 
string TimestampISO [get]
 Gets the timestamp in ISO string format. More...
 
int Bucket [get]
 Gets the bucket to which the measurement belongs. More...
 
int Offset [get]
 Gets the time offset (in seconds) into the bucket to which this measurement belongs. More...
 
string FullSource [get]
 Gets the name source for this measurement instance. More...
 
string UnitLabel [get, set]
 Gets or sets a value indicating whether this instance is aggregate. More...
 
object Tag [get, set]
 Aggregates the specified compiled addition to the current compiled value and flags this instance as aggregated (IsAggregate == true). More...
 
- Properties inherited from Apac.Monitoring.ITimeStamped
DateTime Timestamp [get]
 Gets the timestamp. More...
 
int Bucket [get]
 Gets the bucket, which is a five minute period. There are 12 buckets in an hour and 288 buckets in a day. More...
 
int Offset [get]
 Gets the offset into the bucket in seconds. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Apac.Monitoring.Measurement
static readonly string TimestampFormat = "yyyymmddThhMMss.ffffffzzz"
 
- Protected Member Functions inherited from Apac.Monitoring.Measurement
 Measurement (SerializationInfo info, StreamingContext context)
 Creates a measurement and sets its timestamp to 'now'. More...
 
virtual int OnCompareTo (object obj)
 Called when [compare to]. More...
 

Detailed Description

Defines a value that is the average of several measurements.

Constructor & Destructor Documentation

◆ MeasurementAvg() [1/2]

Apac.Monitoring.MeasurementAvg.MeasurementAvg ( ManagedElement  element,
string  fullSource 
)
inline

Creates a new instance for tracking averages and defaults the timestamp to the current time.

Parameters
elementThe element to which this average applies.

◆ MeasurementAvg() [2/2]

Apac.Monitoring.MeasurementAvg.MeasurementAvg ( DateTime  timestamp,
ManagedElement  element,
string  fullSource 
)
inline

Creates a new instance for tracking averages.

Parameters
elementIdThe element to which this average applies.
timestampThe timestamp of the average.

Member Function Documentation

◆ Add() [1/2]

virtual void Apac.Monitoring.MeasurementAvg.Add ( decimal  measurement)
inlinevirtual

Adds another measurement to be averaged.

Parameters
measurementThe measurement value to be included.


Reimplemented in Apac.Monitoring.WeightedMeasurementAvg.

◆ Add() [2/2]

virtual void Apac.Monitoring.MeasurementAvg.Add ( ushort  measurement)
inlinevirtual

Adds another measurement to be averaged.

Parameters
measurementThe measurement value to be included.

Reimplemented in Apac.Monitoring.WeightedMeasurementAvg.

◆ GetObjectData()

override void Apac.Monitoring.MeasurementAvg.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)
inlinevirtual

Populates a T:System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.

Parameters
infoThe T:System.Runtime.Serialization.SerializationInfo to populate with data.
contextThe destination (see T:System.Runtime.Serialization.StreamingContext) for this serialization.
Exceptions
T:System.Security.SecurityExceptionThe caller does not have the required permission.

Reimplemented from Apac.Monitoring.Measurement.

Property Documentation

◆ CompiledValue

override decimal Apac.Monitoring.MeasurementAvg.CompiledValue
get

The current calculated average for this instance (sum/count). As measurements are added, this property value could change.

◆ SampleCount

uint Apac.Monitoring.MeasurementAvg.SampleCount
get

The number of samples used to create this weighted average.


The documentation for this class was generated from the following file: