Struct TimestampedHealthSnapshot
- Namespace
- DotCompute.Abstractions.Health
- Assembly
- DotCompute.Abstractions.dll
Health snapshot with HLC timestamp for causal ordering.
public readonly struct TimestampedHealthSnapshot : IEquatable<TimestampedHealthSnapshot>, IComparable<TimestampedHealthSnapshot>
- Implements
- Inherited Members
Properties
MonitoringInterval
Gets the monitoring interval that was active when this snapshot was taken.
public TimeSpan MonitoringInterval { get; init; }
Property Value
Snapshot
Gets the health snapshot data.
public required DeviceHealthSnapshot Snapshot { get; init; }
Property Value
Timestamp
Gets the HLC timestamp when this snapshot was taken.
public required HlcTimestamp Timestamp { get; init; }
Property Value
Methods
CompareTo(TimestampedHealthSnapshot)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(TimestampedHealthSnapshot other)
Parameters
otherTimestampedHealthSnapshotAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes otherin the sort order.Zero This instance occurs in the same position in the sort order as other.Greater than zero This instance follows otherin the sort order.
Equals(TimestampedHealthSnapshot)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(TimestampedHealthSnapshot other)
Parameters
otherTimestampedHealthSnapshotAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Operators
operator ==(TimestampedHealthSnapshot, TimestampedHealthSnapshot)
Equality operator.
public static bool operator ==(TimestampedHealthSnapshot left, TimestampedHealthSnapshot right)
Parameters
Returns
operator >(TimestampedHealthSnapshot, TimestampedHealthSnapshot)
Greater than operator (by HLC timestamp).
public static bool operator >(TimestampedHealthSnapshot left, TimestampedHealthSnapshot right)
Parameters
Returns
operator >=(TimestampedHealthSnapshot, TimestampedHealthSnapshot)
Greater than or equal operator (by HLC timestamp).
public static bool operator >=(TimestampedHealthSnapshot left, TimestampedHealthSnapshot right)
Parameters
Returns
operator !=(TimestampedHealthSnapshot, TimestampedHealthSnapshot)
Inequality operator.
public static bool operator !=(TimestampedHealthSnapshot left, TimestampedHealthSnapshot right)
Parameters
Returns
operator <(TimestampedHealthSnapshot, TimestampedHealthSnapshot)
Less than operator (by HLC timestamp).
public static bool operator <(TimestampedHealthSnapshot left, TimestampedHealthSnapshot right)
Parameters
Returns
operator <=(TimestampedHealthSnapshot, TimestampedHealthSnapshot)
Less than or equal operator (by HLC timestamp).
public static bool operator <=(TimestampedHealthSnapshot left, TimestampedHealthSnapshot right)