Vixen
dd8b0a81
csharp
public sealed class NetworkView

Where a session's bandwidth is going, and what is inside one snapshot.

Read the guide page for this →

Remarks

The panel is NetworkView.vxml; this file exists only to make it public. The markup compiler emits a partial class with no accessibility modifier, which is internal — deliberately, so that a component is not public API by accident — and a panel the editor's diagnostics module constructs from another assembly has to be. One hand-written part is the whole of the mechanism.

⚠ A view and not an instrument. Everything it draws is a property Vixen.Net.Diagnostics already exposes — BandwidthLedger's five tables and its totals, and whatever SnapshotInspector.Inspect makes of a packet — and nothing in Vixen.Net was widened to build it. That is the claim doc 16's diagnostics section rests on, and the panel is what tests it.

⚠ It is a Component rather than a Control, which is a choice and not a constraint. Nothing outside the class reads a part of it: the host wires three delegates and the panel draws itself. A panel with no public parts is exactly what a component is for — see StatisticsView, which made the same call — and a test reaches one through UiDocument.ComponentAt rather than through a tree walk.

Fields and properties (7)

  • protected override string TagName
  • public static readonly TimeSpan Interval

    How often a reading is taken, however often the document ticks.

  • public const int Rows

    How many rows each column keeps.

  • public Func<BandwidthLedger?>? Source

    Where the ledger comes from, or when nothing is attached.

  • public Func<ReplicationRegistry?>? Registry

    What names the component types in a packet, or .

  • public Func<ReadOnlyMemory<byte>>? Capture

    The newest snapshot's bytes, exactly as they went on the wire.

  • public Func<NetworkSession?>? Session

    Where round trip, jitter and the loss counters come from, or .

Methods (4)

  • protected override void Build(BuildContext ctx)
  • public void Take()

    Takes a reading now, whether or not the interval has passed.

  • public void Clear()

    Forgets everything the ledger has counted, so the next reading is of what follows.

  • protected override void OnUnmounted()

    Called when the component leaves the tree, before its effects are disposed.

Used by (3)

  • DiagnosticsModuleVixen.Editor.Diagnostics
  • DiagnosticsPanelTestsVixen.Editor.App.Tests
  • NetworkViewTestsVixen.Editor.Debugger.Tests