Class LogTail

Assembly: redb.Tsak.Web.dll

The log lines of one node that this browser tab has seen, kept while the tab is open (see
), so that coming back to the node's log page shows them at once and fetches only what
is new. The node numbers its lines from 0 in each process and keeps the newest of them (2000 by default):
the first visit reads the newest lines; "load older" pages back from the oldest one
shown, at a time, as far as the node still has them;a return reads everything after the last line seen, in one go; lines the node dropped from its buffer in the
meantime are shown as one "N lines skipped" marker;a restart of the node (its start time in the topology changed, or its newest line is older than the last one
seen) starts the tail anew with a marker, since the new process numbers its lines from 0 again.

public sealed class LogTail

Inheritance

Object→LogTail

Properties

BufferCapacity

The size of the node's buffer, as it last said.

public int? BufferCapacity { get; }

Capacity

Rows kept at most; the oldest go first, and "load older" brings them back.

public int Capacity { get; }

HasOlder

Whether the node may still have lines older than the oldest one held.

public bool HasOlder { get; }

LastId

The id of the newest line held, -1 before any.

public long LastId { get; }

LineCount

Lines held, markers not counted.

public int LineCount { get; }

Loaded

Whether the first page was read.

public bool Loaded { get; }

NodeId

The node whose lines these are.

public string NodeId { get; }

OldestId

The id of the oldest line held, null before any.

public long? OldestId { get; }

Rows

The rows, oldest first (a copy).

public IReadOnlyList<LogRow> Rows { get; }

StartedAt

The node's start time when the tail was read, if the topology knows it.

public DateTimeOffset? StartedAt { get; }

Unavailable

Whether the node answered that it keeps no log buffer.

public bool Unavailable { get; }

Methods

Clear()

Empties the view; new lines keep coming, and "load older" brings the cleared ones back.

public void Clear()

LoadOlderAsync(ILogSource, CancellationToken)

Reads the lines before the oldest one held and puts them on top.

public Task LoadOlderAsync(ILogSource source, CancellationToken ct)

SyncAsync(ILogSource, DateTimeOffset?, bool, CancellationToken)

Brings the tail up to date: the first page on the first visit, otherwise every line after the last one seen.

public Task SyncAsync(ILogSource source, DateTimeOffset? startedAt, bool poll, CancellationToken ct)

Constructors

LogTail(string, int)

Creates the tail of node nodeId, keeping at most capacity rows.