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

Models an average created from previously calculated averages by using a weight associated with each average. More...

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

Public Member Functions

 WeightedMeasurementAvg ()
 Initializes a new instance of the WeightedMeasurementAvg class. More...
 
 WeightedMeasurementAvg (ManagedElement element, string fullSource)
 Creates a new instance for tracking averages and defaults the timestamp to the current time. More...
 
 WeightedMeasurementAvg (DateTime timestamp, ManagedElement element, string fullSource)
 Creates a new instance for tracking averages. More...
 
 WeightedMeasurementAvg (DateTime timestamp, ManagedElement element, uint sampleCount, decimal value, string fullSource)
 Creates a new instance from an existing average and sample count. More...
 
void Add (uint weight, decimal average)
 Adds another measurement to be averaged along with its weight (ie: the number of values used to find the average in the first place). More...
 
override void Add (decimal measurement)
 Overrides the base implementation to include a default weight of one. More...
 
override void Add (ushort measurement)
 Overrides the base implemenation to include a default weight of one. More...
 
- Public Member Functions inherited from Apac.Monitoring.MeasurementAvg
 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)
 
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 Member Functions

 WeightedMeasurementAvg (SerializationInfo info, StreamingContext context)
 Initializes a new instance of the WeightedMeasurementAvg class. More...
 
- 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...
 

Additional Inherited Members

- Static Public Attributes inherited from Apac.Monitoring.Measurement
static readonly string TimestampFormat = "yyyymmddThhMMss.ffffffzzz"
 
- Protected Attributes inherited from Apac.Monitoring.MeasurementAvg
decimal _sum = 0
 
uint _sampleCount = 0
 
- Properties inherited from Apac.Monitoring.MeasurementAvg
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...
 

Detailed Description

Models an average created from previously calculated averages by using a weight associated with each average.

Constructor & Destructor Documentation

◆ WeightedMeasurementAvg() [1/5]

Apac.Monitoring.WeightedMeasurementAvg.WeightedMeasurementAvg ( )
inline

Initializes a new instance of the WeightedMeasurementAvg class.

◆ WeightedMeasurementAvg() [2/5]

Apac.Monitoring.WeightedMeasurementAvg.WeightedMeasurementAvg ( 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.
fullSourceThe source of the measurement.

◆ WeightedMeasurementAvg() [3/5]

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

Creates a new instance for tracking averages.

Parameters
elementThe element to which this average applies.
timestampThe timestamp of the average.
fullSourceThe source of the measurement.

◆ WeightedMeasurementAvg() [4/5]

Apac.Monitoring.WeightedMeasurementAvg.WeightedMeasurementAvg ( DateTime  timestamp,
ManagedElement  element,
uint  sampleCount,
decimal  value,
string  fullSource 
)
inline

Creates a new instance from an existing average and sample count.

Parameters
elementThe element to which this average applies.
timestampThe timestamp of the average.
sampleCountThe number of samples used to create the average.
valueThe average value.
fullSourceThe source of the measurement.

◆ WeightedMeasurementAvg() [5/5]

Apac.Monitoring.WeightedMeasurementAvg.WeightedMeasurementAvg ( SerializationInfo  info,
StreamingContext  context 
)
inlineprotected

Initializes a new instance of the WeightedMeasurementAvg class.

Parameters
infoThe info.
contextThe context.

Member Function Documentation

◆ Add() [1/3]

override void Apac.Monitoring.WeightedMeasurementAvg.Add ( decimal  measurement)
inlinevirtual

Overrides the base implementation to include a default weight of one.

Parameters
measurementThe measurement to include in the average.

Reimplemented from Apac.Monitoring.MeasurementAvg.

◆ Add() [2/3]

void Apac.Monitoring.WeightedMeasurementAvg.Add ( uint  weight,
decimal  average 
)
inline

Adds another measurement to be averaged along with its weight (ie: the number of values used to find the average in the first place).

Parameters
weightThe number of values used to find an average.
averageThe average value to be included.


◆ Add() [3/3]

override void Apac.Monitoring.WeightedMeasurementAvg.Add ( ushort  measurement)
inlinevirtual

Overrides the base implemenation to include a default weight of one.

Parameters
measurementThe measurement to inclue in the average.

Reimplemented from Apac.Monitoring.MeasurementAvg.


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