Skip to content

MockStreamTiming

ClassMockMagiccom.wetzold.mock-magic
public static class MockStreamTiming

Timing rules of the stream rhythms, shared by MockStream and other tools' mock streams so a rhythm means the same everywhere.

public const float MinDripGap = 0.05

Shortest Drip gap, as a fraction of the average interval.

Returns

System.Single

public const float MaxDripGap = 5

Longest Drip gap, as a multiple of the average interval.

Returns

System.Single

public static int PointsPerEmission(StreamRhythm rhythm, int requested)

Points one emission carries: StreamRhythm.Drip always emits a single point, the other rhythms requested points, at least one.

Parameters

Name Type
rhythm MockMagic.StreamRhythm
requested System.Int32

Returns

System.Int32

public static float DripGap(float averageInterval, double unit)

The wait before the next StreamRhythm.Drip point. Gaps are exponentially distributed around averageInterval, like independent events such as sensor reads, trades or log entries: mostly short with occasional long pauses, kept between MockStreamTiming.MinDripGap and MockStreamTiming.MaxDripGap times the average.

Parameters

Name Type Description
averageInterval System.Single Average seconds between points.
unit System.Double A uniform random value in [0, 1), so seeded random sources replay the same gaps.

Returns

System.Single