Table of Contents

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

TimeSpan

Snapshot

Gets the health snapshot data.

public required DeviceHealthSnapshot Snapshot { get; init; }

Property Value

DeviceHealthSnapshot

Timestamp

Gets the HLC timestamp when this snapshot was taken.

public required HlcTimestamp Timestamp { get; init; }

Property Value

HlcTimestamp

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

other TimestampedHealthSnapshot

An 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 other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in 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

other TimestampedHealthSnapshot

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and 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

left TimestampedHealthSnapshot
right TimestampedHealthSnapshot

Returns

bool

operator >(TimestampedHealthSnapshot, TimestampedHealthSnapshot)

Greater than operator (by HLC timestamp).

public static bool operator >(TimestampedHealthSnapshot left, TimestampedHealthSnapshot right)

Parameters

left TimestampedHealthSnapshot
right TimestampedHealthSnapshot

Returns

bool

operator >=(TimestampedHealthSnapshot, TimestampedHealthSnapshot)

Greater than or equal operator (by HLC timestamp).

public static bool operator >=(TimestampedHealthSnapshot left, TimestampedHealthSnapshot right)

Parameters

left TimestampedHealthSnapshot
right TimestampedHealthSnapshot

Returns

bool

operator !=(TimestampedHealthSnapshot, TimestampedHealthSnapshot)

Inequality operator.

public static bool operator !=(TimestampedHealthSnapshot left, TimestampedHealthSnapshot right)

Parameters

left TimestampedHealthSnapshot
right TimestampedHealthSnapshot

Returns

bool

operator <(TimestampedHealthSnapshot, TimestampedHealthSnapshot)

Less than operator (by HLC timestamp).

public static bool operator <(TimestampedHealthSnapshot left, TimestampedHealthSnapshot right)

Parameters

left TimestampedHealthSnapshot
right TimestampedHealthSnapshot

Returns

bool

operator <=(TimestampedHealthSnapshot, TimestampedHealthSnapshot)

Less than or equal operator (by HLC timestamp).

public static bool operator <=(TimestampedHealthSnapshot left, TimestampedHealthSnapshot right)

Parameters

left TimestampedHealthSnapshot
right TimestampedHealthSnapshot

Returns

bool