Vixen
02b45cc4
csharp
public sealed class ProfileCapture

Everything one press of the capture button collected.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Immutable, and that is what makes comparison possible at all. Doc 20's E4 asks for "capture/compare", which needs two captures to exist at once — so a capture is a value taken out of the rings rather than a window onto them, and the rings are free to wrap the moment it is taken.

⚠ The window is derived from the samples, not from a clock. A capture's start is its earliest BeginTicks and its end is the largest begin-plus-duration — because the samples arrive from several threads whose rings were filled at different moments, and a window taken from Stopwatch.GetTimestamp around the collect call would be wider than the data on one side and narrower on the other.

Fields and properties (13)

  • public static ProfileCapture Empty

    The capture with nothing in it, which is what a panel shows before the first press.

  • public string Source

    Which source it came from.

  • public IReadOnlyList<ProfileThread> Threads

    The threads that recorded something, busiest first.

  • public IReadOnlyList<ProfileEntry> Summary

    Every scope in it, aggregated by key.

  • public int SampleCount

    How many samples it holds, across every thread.

  • public long Dropped

    How many the source lost before this was taken.

  • public long BeginTicks

    When the earliest scope in it began, in Stopwatch ticks.

  • public long EndTicks

    When the last scope in it ended.

  • public int FirstFrame

    The lowest frame index any sample was attributed to.

  • public int LastFrame

    The highest.

  • public int FrameCount

    How many frames it spans, never fewer than one.

  • public double DurationMilliseconds

    How wide the capture's window is, in milliseconds.

  • public bool IsEmpty

    Whether anything was collected.

Methods (3)

  • public ProfileCapture(string source, ProfilerThreadSamples[] collected, long dropped = 0)

    Builds a capture out of collected samples.

  • public float Fraction(long ticks)

    Turns ticks into a fraction of the capture's window.

  • public static IReadOnlyList<FlameNode> Frame(ProfileThread thread, int frame)

    The samples belonging to one frame, on one thread.

Used by (7)

  • CaptureComparisonVixen.Editor.Profiler
  • CaptureTestsVixen.Editor.Profiler.Tests
  • DiagnosticsPanelTestsVixen.Editor.App.Tests
  • EditorApplicationVixen.Editor.App
  • ProfilerModelVixen.Editor.Profiler
  • ProfilerModelTestsVixen.Editor.Profiler.Tests
  • ProfilerViewVixen.Editor.Profiler