Skip to content

StateSnapshot

public sealed class StateSnapshot

Namespace Snitch.Api

A small ordered name->count distribution returned by a state provider.

Example

Profiler.RegisterStateProvider("MyMod.Widgets", () =>
new StateSnapshot { Title = "Widgets" }.Add("red", red).Add("green", green).Add("blue", blue));
public string Title

The heading shown above the distribution.

Value Free text, e.g. “Example Widgets”. Null shows the provider id.

public int Total

The total the buckets are measured against.

Value 0 (the default) uses the sum of all bucket counts.

public readonly List<Bucket> Buckets = new List<Bucket>()

Type: Bucket

The buckets in the order they are shown.

public StateSnapshot Add(string name, int count)

Append a bucket.

Parameter
nameThe bucket label, e.g. “red”.
countHow many items fall into the bucket.

Returns This snapshot, for chaining.

public void Clear()