README

zlhahaha/moonsim/core does not have a README file

#
Backoff

pub(all) struct Backoff {
initial : Int
factor : Int
max_delay : Int
jitter : Int
current : Int
}

#
Backoff::new

fn Backoff::new(initial? : Int, factor? : Int, max_delay? : Int, jitter? : Int) -> Backoff

#
Backoff::next_delay

fn Backoff::next_delay(self : Backoff, rng : Rng) -> Int

#
Backoff::reset

fn Backoff::reset(self : Backoff) -> Unit

#
CounterSample

pub(all) struct CounterSample {
name : String
value : Int
}

#
Duration

pub(all) struct Duration {
value : Int
} derive(Eq,
Debug
)

Virtual simulation duration.

#
Duration::is_zero

fn Duration::is_zero(self : Duration) -> Bool

#
Duration::scale

fn Duration::scale(self : Duration, factor : Int) -> Duration

#
Duration::to_int

fn Duration::to_int(self : Duration) -> Int

#
EventFailureCase

pub(all) struct EventFailureCase {
seed : UInt64
rule : String
digest : UInt64
events : Array[EventRecord]
policy : EventMutationPolicy
source_events : Array[EventRecord]
}

#
EventFailureCase::replay

#
EventId

pub(all) struct EventId {
value : Int
} derive(Eq,
Debug
)

Stable simulation event identifier.

#
EventId::to_int

fn EventId::to_int(self : EventId) -> Int

#
EventKind

pub enum EventKind {
Message
Task
Timer
StateTransition
ExternalCall
}

Built-in event categories for deterministic model traces.

#
EventKind::label

fn EventKind::label(self : EventKind) -> String

#
EventMutationPolicy

pub(all) struct EventMutationPolicy {
seed : UInt64
max_delay : Int
delay_percent : Int
drop_percent : Int
duplicate_percent : Int
reorder_same_tick : Bool
failure_percent : Int
}

#
EventRecord

pub(all) struct EventRecord {
id : Int
kind : EventKind
tick : Int
priority : Int
correlation_id : String
source : String
target : String
label : String
parent_id : Int
payload : String
dropped : Bool
failed : Bool
}

#
EventReplayResult

pub(all) struct EventReplayResult {
seed : UInt64
digest : UInt64
events : Array[EventRecord]
scheduled : Int
dropped : Int
duplicated : Int
failed : Int
}

#
EventReplayResult::invariants

#
EventReplayResult::matches_digest

fn EventReplayResult::matches_digest(self : EventReplayResult, other : EventReplayResult) -> Bool

#
EventStream

pub(all) struct EventStream {
next_id : Int
events : Array[EventRecord]
}

#
EventStream::append

fn EventStream::append(self : EventStream, event : EventRecord) -> EventRecord

#
EventStream::digest

fn EventStream::digest(self : EventStream) -> UInt64

#
EventStream::events

fn EventStream::events(self : EventStream) -> Array[EventRecord]

#
EventStream::invariants

fn EventStream::invariants(self : EventStream) -> InvariantReport

#
EventStream::new

#
EventStream::ordered

fn EventStream::ordered(self : EventStream) -> Array[EventRecord]

#
EventStream::record

fn EventStream::record(self : EventStream, kind : EventKind, tick : Int, label : String, correlation_id? : String, source? : String, target? : String, parent_id? : Int, payload? : String, priority? : Int, dropped? : Bool, failed? : Bool) -> EventRecord

#
EventStream::replay

#
EventStream::restore

fn EventStream::restore(self : EventStream, snapshot : EventStreamSnapshot) -> Unit

#
EventStream::snapshot

#
EventStreamSnapshot

pub(all) struct EventStreamSnapshot {
next_id : Int
events : Array[EventRecord]
}

#
EventView

pub(all) struct EventView {
id : Int
tick : Int
priority : Int
name : String
status : String
}

#
ForkComparison

pub(all) struct ForkComparison {
left_name : String
right_name : String
left_digest : UInt64
right_digest : UInt64
same_digest : Bool
left_events : Int
right_events : Int
}

#
ForkComparison::summary

fn ForkComparison::summary(self : ForkComparison) -> String

#
IntRange

pub(all) struct IntRange {
min : Int
max : Int
}

#
InvariantCheck

pub(all) struct InvariantCheck {
name : String
passed : Bool
detail : String
}

#
InvariantReport

pub(all) struct InvariantReport {
subject : String
checks : Array[InvariantCheck]
}

#
InvariantReport::add

#
InvariantReport::check_count

fn InvariantReport::check_count(self : InvariantReport) -> Int

#
InvariantReport::failed_count

fn InvariantReport::failed_count(self : InvariantReport) -> Int

#
InvariantReport::has_check

fn InvariantReport::has_check(self : InvariantReport, name : String) -> Bool

#
InvariantReport::is_empty

fn InvariantReport::is_empty(self : InvariantReport) -> Bool

#
InvariantReport::merge

#
InvariantReport::new

fn InvariantReport::new(subject : String) -> InvariantReport

#
InvariantReport::only_failures

fn InvariantReport::only_failures(self : InvariantReport) -> InvariantReport

#
InvariantReport::passed

fn InvariantReport::passed(self : InvariantReport) -> Bool

#
InvariantReport::passed_count

fn InvariantReport::passed_count(self : InvariantReport) -> Int

#
InvariantReport::render

fn InvariantReport::render(self : InvariantReport) -> String

#
InvariantReport::summary

fn InvariantReport::summary(self : InvariantReport) -> String

#
Message

pub(all) struct Message {
id : Int
from : String
to : String
body : String
send_tick : Int
deliver_tick : Int
dropped : Bool
}

#
MessageBus

pub(all) struct MessageBus {
next_message_id : Int
messages : Array[Message]
}

#
MessageBus::deliver_due

fn MessageBus::deliver_due(self : MessageBus, sim : Sim) -> Int

#
MessageBus::drop

fn MessageBus::drop(self : MessageBus, sim : Sim, id : Int) -> Bool

#
MessageBus::event_stream

fn MessageBus::event_stream(self : MessageBus) -> EventStream

Projects message send and delivery facts into the generic event stream.

#
MessageBus::messages

fn MessageBus::messages(self : MessageBus) -> Array[Message]

#
MessageBus::new

fn MessageBus::new() -> MessageBus

#
MessageBus::pending

fn MessageBus::pending(self : MessageBus, sim : Sim) -> Int

#
MessageBus::send

fn MessageBus::send(self : MessageBus, sim : Sim, from : String, to : String, body : String, delay? : Int) -> Int

#
MetricDelta

pub(all) struct MetricDelta {
name : String
before : Int
after : Int
delta : Int
}

#
MetricDiff

pub(all) struct MetricDiff {
counters : Array[MetricDelta]
gauges : Array[MetricDelta]
sample_delta : Int
}

#
MetricDiff::summary

fn MetricDiff::summary(self : MetricDiff) -> String

#
MetricSnapshot

pub(all) struct MetricSnapshot {
counters : Array[CounterSample]
gauges : Array[CounterSample]
samples : Array[CounterSample]
}

#
Metrics

pub(all) struct Metrics {
counters : Array[CounterSample]
gauges : Array[CounterSample]
samples : Array[CounterSample]
}

#
Metrics::counter

fn Metrics::counter(self : Metrics, name : String) -> Int

#
Metrics::diff_from

fn Metrics::diff_from(self : Metrics, before : MetricSnapshot) -> MetricDiff

#
Metrics::distribution

fn Metrics::distribution(self : Metrics, name : String) -> SampleDistribution

#
Metrics::gauge

fn Metrics::gauge(self : Metrics, name : String) -> Int

#
Metrics::gauge_snapshot

fn Metrics::gauge_snapshot(self : Metrics) -> Array[CounterSample]

#
Metrics::inc

fn Metrics::inc(self : Metrics, name : String, delta? : Int) -> Unit

#
Metrics::metric_snapshot

fn Metrics::metric_snapshot(self : Metrics) -> MetricSnapshot

#
Metrics::new

fn Metrics::new() -> Metrics

#
Metrics::sample

fn Metrics::sample(self : Metrics, name : String, value : Int) -> Unit

#
Metrics::sample_count

fn Metrics::sample_count(self : Metrics, name : String) -> Int

#
Metrics::sample_snapshot

fn Metrics::sample_snapshot(self : Metrics) -> Array[CounterSample]

#
Metrics::sample_values

fn Metrics::sample_values(self : Metrics, name : String) -> Array[Int]

#
Metrics::set_gauge

fn Metrics::set_gauge(self : Metrics, name : String, value : Int) -> Unit

#
Metrics::snapshot

fn Metrics::snapshot(self : Metrics) -> Array[CounterSample]

#
Metrics::summary

fn Metrics::summary(self : Metrics, name : String) -> SampleSummary

#
QueueStats

pub(all) struct QueueStats {
pending : Int
cancelled : Int
earliest_tick : Int
latest_tick : Int
}

#
ReplayBaseline

pub(all) struct ReplayBaseline {
name : String
digest : UInt64
entries : Array[TraceEntry]
counters : Array[CounterSample]
gauges : Array[CounterSample]
}

#
ReplayComparison

pub(all) struct ReplayComparison {
name : String
matched : Bool
trace : TraceComparison
counter_mismatches : Int
gauge_mismatches : Int
}

#
ReplayComparison::summary

fn ReplayComparison::summary(self : ReplayComparison) -> String

#
Rng

pub(all) struct Rng {
state : UInt64
}

Deterministic pseudo-random generator for reproducible simulations.

This generator is not cryptographic. It is intentionally small and portable so simulations behave the same across MoonBit targets.

#
Rng::choose

fn[T] Rng::choose(self : Rng, items : Array[T]) -> T?

#
Rng::choose_weighted

fn Rng::choose_weighted(self : Rng, choices : Array[WeightedChoice]) -> String?

#
Rng::new

fn Rng::new(seed : UInt64) -> Rng

#
Rng::next_bool

fn Rng::next_bool(self : Rng) -> Bool

#
Rng::next_int

fn Rng::next_int(self : Rng, bound : Int) -> Int

#
Rng::next_range

fn Rng::next_range(self : Rng, low : Int, high : Int) -> Int

#
Rng::next_u64

fn Rng::next_u64(self : Rng) -> UInt64

#
Rng::shuffle

fn[T] Rng::shuffle(self : Rng, items : Array[T]) -> Array[T]

#
Rng::state

fn Rng::state(self : Rng) -> UInt64

#
RunReport

pub(all) struct RunReport {
steps : Int
final_tick : Int
pending : Int
reason : RunStopReason
}

#
RunStep

pub(all) enum RunStep {
Executed(ScheduledEvent)
Idle
}

#
RunStopReason

pub(all) enum RunStopReason {
Idle
StepLimit
TickLimit
}

#
SampleDistribution

pub(all) struct SampleDistribution {
name : String
count : Int
min : Int
max : Int
median : Int
p90 : Int
}

#
SampleSummary

pub(all) struct SampleSummary {
name : String
count : Int
min : Int
max : Int
sum : Int
}

#
SampleSummary::average

fn SampleSummary::average(self : SampleSummary) -> Double

#
Scenario

pub(all) struct Scenario {
name : String
seed : UInt64
max_steps : Int
expectations : Array[ScenarioExpectation]
}

#
Scenario::create_sim

fn Scenario::create_sim(self : Scenario) -> Sim

#
Scenario::expect_counter

fn Scenario::expect_counter(self : Scenario, name : String, value : Int) -> Scenario

#
Scenario::expect_counter_range

fn Scenario::expect_counter_range(self : Scenario, name : String, min : Int, max : Int) -> Scenario

#
Scenario::expect_digest

fn Scenario::expect_digest(self : Scenario, value : UInt64) -> Scenario

#
Scenario::expect_final_tick

fn Scenario::expect_final_tick(self : Scenario, value : Int) -> Scenario

#
Scenario::expect_final_tick_range

fn Scenario::expect_final_tick_range(self : Scenario, min : Int, max : Int) -> Scenario

#
Scenario::expect_gauge

fn Scenario::expect_gauge(self : Scenario, name : String, value : Int) -> Scenario

#
Scenario::expect_no_validation_issues

fn Scenario::expect_no_validation_issues(self : Scenario) -> Scenario

#
Scenario::expect_pending

fn Scenario::expect_pending(self : Scenario, value : Int) -> Scenario

#
Scenario::expect_sample_count

fn Scenario::expect_sample_count(self : Scenario, name : String, value : Int) -> Scenario

#
Scenario::expect_summary_average_range

fn Scenario::expect_summary_average_range(self : Scenario, name : String, min : Int, max : Int) -> Scenario

#
Scenario::expect_summary_max

fn Scenario::expect_summary_max(self : Scenario, name : String, value : Int) -> Scenario

#
Scenario::expect_summary_min

fn Scenario::expect_summary_min(self : Scenario, name : String, value : Int) -> Scenario

#
Scenario::expect_trace_contains

fn Scenario::expect_trace_contains(self : Scenario, text : String) -> Scenario

#
Scenario::expect_trace_kind_count

fn Scenario::expect_trace_kind_count(self : Scenario, kind : String, count : Int) -> Scenario

#
Scenario::new

fn Scenario::new(name : String, seed? : UInt64, max_steps? : Int) -> Scenario

#
Scenario::verify

fn Scenario::verify(self : Scenario, sim : Sim) -> ScenarioReport

#
ScenarioCase

pub(all) struct ScenarioCase {
scenario : Scenario
sim : Sim
}

#
ScenarioExpectation

pub(all) struct ScenarioExpectation {
kind : String
name : String
expected : String
}

#
ScenarioFailure

pub(all) struct ScenarioFailure {
kind : String
name : String
expected : String
actual : String
}

#
ScenarioReport

pub(all) struct ScenarioReport {
name : String
passed : Bool
steps : Int
final_tick : Int
digest : UInt64
failures : Array[ScenarioFailure]
}

#
ScenarioReport::detailed_text

fn ScenarioReport::detailed_text(self : ScenarioReport) -> String

#
ScenarioReport::failure_count

fn ScenarioReport::failure_count(self : ScenarioReport) -> Int

#
ScenarioReport::failure_text

fn ScenarioReport::failure_text(self : ScenarioReport) -> String

#
ScenarioReport::summary

fn ScenarioReport::summary(self : ScenarioReport) -> String

#
ScenarioSuite

pub(all) struct ScenarioSuite {
name : String
cases : Array[ScenarioCase]
}

#
ScenarioSuite::add

fn ScenarioSuite::add(self : ScenarioSuite, scenario : Scenario, sim : Sim) -> ScenarioSuite

#
ScenarioSuite::new

fn ScenarioSuite::new(name : String) -> ScenarioSuite

#
ScenarioSuite::run

#
ScenarioSuiteReport

pub(all) struct ScenarioSuiteReport {
name : String
reports : Array[ScenarioReport]
}

#
ScenarioSuiteReport::failed_count

fn ScenarioSuiteReport::failed_count(self : ScenarioSuiteReport) -> Int

#
ScenarioSuiteReport::passed

fn ScenarioSuiteReport::passed(self : ScenarioSuiteReport) -> Bool

#
ScenarioSuiteReport::passed_count

fn ScenarioSuiteReport::passed_count(self : ScenarioSuiteReport) -> Int

#
ScenarioSuiteReport::render

fn ScenarioSuiteReport::render(self : ScenarioSuiteReport) -> String

#
ScenarioSuiteReport::summary

fn ScenarioSuiteReport::summary(self : ScenarioSuiteReport) -> String

#
ScheduledEvent

pub(all) struct ScheduledEvent {
id : Int
tick : Int
priority : Int
name : String
cancelled : Bool
repeat_every : Int
remaining_runs : Int
}

A scheduled simulation event.

Events are ordered by tick, priority, then id. The id tie-breaker makes same-tick execution stable and replayable.

#
ScheduledEvent::cancel

fn ScheduledEvent::cancel(self : ScheduledEvent) -> Unit

#
ScheduledEvent::is_cancelled

fn ScheduledEvent::is_cancelled(self : ScheduledEvent) -> Bool

#
ScheduledEvent::is_repeating

fn ScheduledEvent::is_repeating(self : ScheduledEvent) -> Bool

#
ScheduledEvent::new

fn ScheduledEvent::new(id : Int, tick : Int, name : String, priority? : Int) -> ScheduledEvent

#
ScheduledEvent::next_repeat

fn ScheduledEvent::next_repeat(self : ScheduledEvent) -> ScheduledEvent

#
ScheduledEvent::repeating

fn ScheduledEvent::repeating(id : Int, tick : Int, name : String, every : Int, times : Int, priority? : Int) -> ScheduledEvent

#
Sim

pub(all) struct Sim {
now : Int
next_id : Int
events : Array[ScheduledEvent]
trace_entries : Array[TraceEntry]
rng : Rng
metrics : Metrics
}

Deterministic simulation state.

#
Sim::cancel

fn Sim::cancel(self : Sim, event_id : Int) -> Bool

#
Sim::choose

fn[T] Sim::choose(self : Sim, label : String, items : Array[T]) -> T?

#
Sim::choose_weighted

fn Sim::choose_weighted(self : Sim, label : String, choices : Array[WeightedChoice]) -> String?

#
Sim::digest

fn Sim::digest(self : Sim) -> UInt64

#
Sim::event_views

fn Sim::event_views(self : Sim) -> Array[EventView]

#
Sim::inc_counter

fn Sim::inc_counter(self : Sim, name : String, delta? : Int) -> Unit

#
Sim::install_timer

fn Sim::install_timer(self : Sim, plan : TimerPlan) -> Int

#
Sim::metrics

fn Sim::metrics(self : Sim) -> Metrics

#
Sim::new

fn Sim::new(seed? : UInt64) -> Sim

#
Sim::next_int

fn Sim::next_int(self : Sim, bound : Int) -> Int

#
Sim::next_range

fn Sim::next_range(self : Sim, low : Int, high : Int) -> Int

#
Sim::pending_count

fn Sim::pending_count(self : Sim) -> Int

#
Sim::queue_stats

fn Sim::queue_stats(self : Sim) -> QueueStats

#
Sim::record

fn Sim::record(self : Sim, event_id : Int, kind : String, detail : String) -> Unit

#
Sim::record_transition

fn Sim::record_transition(self : Sim, machine : StateMachine, result : TransitionResult) -> Unit

#
Sim::restore

fn Sim::restore(snapshot : SimSnapshot) -> Sim

#
Sim::run_next

fn Sim::run_next(self : Sim) -> ScheduledEvent?

#
Sim::run_report_until_idle

fn Sim::run_report_until_idle(self : Sim, max_steps? : Int) -> RunReport

#
Sim::run_until_idle

fn Sim::run_until_idle(self : Sim, max_steps? : Int) -> Int

#
Sim::run_until_tick

fn Sim::run_until_tick(self : Sim, tick_limit : Int, max_steps? : Int) -> RunReport

#
Sim::sample

fn Sim::sample(self : Sim, name : String, value : Int) -> Unit

#
Sim::schedule_after

fn Sim::schedule_after(self : Sim, delay : Int, name : String, priority? : Int) -> Int

#
Sim::schedule_after_duration

fn Sim::schedule_after_duration(self : Sim, delay : Duration, name : String, priority? : Int) -> EventId

#
Sim::schedule_at

fn Sim::schedule_at(self : Sim, tick : Int, name : String, priority? : Int) -> Int

#
Sim::schedule_at_tick

fn Sim::schedule_at_tick(self : Sim, at : Tick, name : String, priority? : Int) -> EventId

#
Sim::schedule_backoff

fn Sim::schedule_backoff(self : Sim, backoff : Backoff, name : String) -> Int

#
Sim::schedule_repeating

fn Sim::schedule_repeating(self : Sim, start_after : Int, every : Int, times : Int, name : String, priority? : Int) -> Int

#
Sim::schedule_timeout

fn Sim::schedule_timeout(self : Sim, after : Int, name : String) -> Int

#
Sim::set_gauge

fn Sim::set_gauge(self : Sim, name : String, value : Int) -> Unit

#
Sim::shuffle

fn[T] Sim::shuffle(self : Sim, label : String, items : Array[T]) -> Array[T]

#
Sim::snapshot

fn Sim::snapshot(self : Sim, name? : String) -> SimSnapshot

#
Sim::step

fn Sim::step(self : Sim) -> RunStep

#
Sim::tick

fn Sim::tick(self : Sim) -> Tick

#
Sim::time

fn Sim::time(self : Sim) -> Int

#
Sim::timeline

fn Sim::timeline(self : Sim, bucket_size? : Int) -> TimelineView

#
Sim::timeline_text

fn Sim::timeline_text(self : Sim) -> String

#
Sim::trace

fn Sim::trace(self : Sim) -> Array[TraceEntry]

#
Sim::trace_stats

fn Sim::trace_stats(self : Sim) -> TraceStats

#
Sim::trace_text

fn Sim::trace_text(self : Sim) -> String

#
Sim::validate

fn Sim::validate(self : Sim) -> ValidationReport

#
SimSnapshot

pub(all) struct SimSnapshot {
name : String
time : Int
next_id : Int
rng_state : UInt64
digest : UInt64
events : Array[ScheduledEvent]
counters : Array[CounterSample]
gauges : Array[CounterSample]
samples : Array[CounterSample]
}

#
SimSnapshot::fork

fn SimSnapshot::fork(self : SimSnapshot, name : String) -> Sim

#
StateMachine

pub(all) struct StateMachine {
name : String
state : String
transitions : Array[Transition]
history : Array[TransitionResult]
}

#
StateMachine::add

fn StateMachine::add(self : StateMachine, transition : Transition) -> StateMachine

#
StateMachine::event_stream

fn StateMachine::event_stream(self : StateMachine) -> EventStream

Projects accepted and rejected transitions into a causally linked event stream.

#
StateMachine::history

#
StateMachine::new

fn StateMachine::new(name : String, initial : String) -> StateMachine

#
StateMachine::send

fn StateMachine::send(self : StateMachine, event : String) -> TransitionResult

#
StateMachine::state

fn StateMachine::state(self : StateMachine) -> String

#
Tick

pub(all) struct Tick {
value : Int
} derive(Eq,
Debug
)

Virtual simulation tick.

#
Tick::compare

fn Tick::compare(self : Tick, other : Tick) -> Int

#
Tick::diff

fn Tick::diff(self : Tick, earlier : Tick) -> Duration

#
Tick::plus

fn Tick::plus(self : Tick, delta : Duration) -> Tick

#
Tick::to_int

fn Tick::to_int(self : Tick) -> Int

#
TimelineBucket

pub(all) struct TimelineBucket {
start_tick : Int
end_tick : Int
events : Int
executions : Int
metrics : Int
messages : Int
}

#
TimelineBucket::line

fn TimelineBucket::line(self : TimelineBucket) -> String

#
TimelineView

pub(all) struct TimelineView {
bucket_size : Int
buckets : Array[TimelineBucket]
}

#
TimelineView::bucket_count

fn TimelineView::bucket_count(self : TimelineView) -> Int

#
TimelineView::peak_bucket

fn TimelineView::peak_bucket(self : TimelineView) -> TimelineBucket

#
TimelineView::render

fn TimelineView::render(self : TimelineView) -> String

#
TimelineView::total_events

fn TimelineView::total_events(self : TimelineView) -> Int

#
TimerPlan

pub(all) struct TimerPlan {
name : String
start_after : Int
interval : Int
times : Int
priority : Int
}

#
TimerPlan::event_stream

fn TimerPlan::event_stream(self : TimerPlan) -> EventStream

Projects a timer plan into the common deterministic event representation.

#
TraceComparison

pub(all) struct TraceComparison {
matched : Bool
checked : Int
left_digest : UInt64
right_digest : UInt64
mismatch : TraceMismatch?
}

#
TraceComparison::summary

fn TraceComparison::summary(self : TraceComparison) -> String

#
TraceEntry

pub(all) struct TraceEntry {
tick : Int
event_id : Int
kind : String
detail : String
}

A deterministic record of an action observed during a simulation run.

#
TraceEntry::format

fn TraceEntry::format(self : TraceEntry) -> String

#
TraceEntry::to_line

fn TraceEntry::to_line(self : TraceEntry) -> String

#
TraceExpectation

pub(all) struct TraceExpectation {
passed : Bool
label : String
expected : String
actual : String
}

#
TraceKindCount

pub(all) struct TraceKindCount {
kind : String
count : Int
}

#
TraceMismatch

pub(all) struct TraceMismatch {
index : Int
left : String
right : String
reason : String
}

#
TraceQuery

pub(all) struct TraceQuery {
kind : String
detail : String
min_tick : Int
max_tick : Int
}

#
TraceQuery::matches

fn TraceQuery::matches(self : TraceQuery, entry : TraceEntry) -> Bool

#
TraceQueryResult

pub(all) struct TraceQueryResult {
entries : Array[TraceEntry]
first_tick : Int
last_tick : Int
kind_counts : Array[TraceKindCount]
}

#
TraceQueryResult::kind_count

fn TraceQueryResult::kind_count(self : TraceQueryResult, kind : String) -> Int

#
TraceQueryResult::summary

fn TraceQueryResult::summary(self : TraceQueryResult) -> String

#
TraceStats

pub(all) struct TraceStats {
entries : Int
schedules : Int
executions : Int
cancellations : Int
rng_draws : Int
metrics : Int
messages : Int
}

#
TraceStats::summary

fn TraceStats::summary(self : TraceStats) -> String

#
Transition

pub(all) struct Transition {
from : String
event : String
to : String
action : String
}

#
TransitionResult

pub(all) struct TransitionResult {
accepted : Bool
from : String
event : String
to : String
action : String
reason : String
}

#
ValidationIssue

pub(all) struct ValidationIssue {
code : String
message : String
severity : String
}

#
ValidationReport

pub(all) struct ValidationReport {
subject : String
issues : Array[ValidationIssue]
}

#
ValidationReport::passed

fn ValidationReport::passed(self : ValidationReport) -> Bool

#
ValidationReport::summary

fn ValidationReport::summary(self : ValidationReport) -> String

#
ValidationReport::text

fn ValidationReport::text(self : ValidationReport) -> String

#
WeightedChoice

pub(all) struct WeightedChoice {
label : String
weight : Int
}

#
build_timeline

fn build_timeline(entries : Array[TraceEntry], bucket_size? : Int) -> TimelineView

#
check_counter_at_least

fn check_counter_at_least(sim : Sim, name : String, minimum : Int) -> InvariantCheck

#
check_no_pending

fn check_no_pending(sim : Sim) -> InvariantCheck

#
check_sim_invariants

fn check_sim_invariants(sim : Sim) -> InvariantReport

#
compare_event

fn compare_event(a : ScheduledEvent, b : ScheduledEvent) -> Int

#
compare_forks

fn compare_forks(left_name : String, left : Sim, right_name : String, right : Sim) -> ForkComparison

#
compare_replay

fn compare_replay(baseline : ReplayBaseline, sim : Sim) -> ReplayComparison

#
compare_traces

fn compare_traces(left : Array[TraceEntry], right : Array[TraceEntry]) -> TraceComparison

#
diff_metrics

fn diff_metrics(before : MetricSnapshot, after : MetricSnapshot) -> MetricDiff

#
duration

fn duration(value : Int) -> Duration

#
event_failure_case

fn event_failure_case(rule : String, source : EventStream, policy : EventMutationPolicy) -> EventFailureCase

#
event_id

fn event_id(value : Int) -> EventId

#
event_mutation_policy

fn event_mutation_policy(seed? : UInt64, max_delay? : Int, delay_percent? : Int, drop_percent? : Int, duplicate_percent? : Int, reorder_same_tick? : Bool, failure_percent? : Int) -> EventMutationPolicy

#
event_record

fn event_record(kind : EventKind, tick : Int, label : String, correlation_id? : String, source? : String, target? : String, parent_id? : Int, payload? : String, priority? : Int, dropped? : Bool, failed? : Bool) -> EventRecord

#
expect_trace_contains_detail

fn expect_trace_contains_detail(entries : Array[TraceEntry], detail : String) -> TraceExpectation

#
expect_trace_contains_kind

fn expect_trace_contains_kind(entries : Array[TraceEntry], kind : String) -> TraceExpectation

#
expect_trace_digest

fn expect_trace_digest(entries : Array[TraceEntry], digest : UInt64) -> TraceExpectation

#
expect_trace_kind_count

fn expect_trace_kind_count(entries : Array[TraceEntry], kind : String, expected : Int) -> TraceExpectation

#
expect_trace_monotonic_ticks

fn expect_trace_monotonic_ticks(entries : Array[TraceEntry]) -> TraceExpectation

#
expect_trace_order

fn expect_trace_order(entries : Array[TraceEntry], before_detail : String, after_detail : String) -> TraceExpectation

#
external_call_event_kind

fn external_call_event_kind() -> EventKind

#
invariant_check

fn invariant_check(name : String, passed : Bool, detail? : String) -> InvariantCheck

#
message_event_kind

fn message_event_kind() -> EventKind

#
metrics_counter_delta

fn metrics_counter_delta(left : Metrics, right : Metrics, name : String) -> Int

#
query_trace

fn query_trace(entries : Array[TraceEntry], query : TraceQuery) -> TraceQueryResult

#
replay_baseline

fn replay_baseline(name : String, sim : Sim) -> ReplayBaseline

#
state_transition_event_kind

fn state_transition_event_kind() -> EventKind

#
task_event_kind

fn task_event_kind() -> EventKind

#
tick

fn tick(value : Int) -> Tick

#
timer_event_kind

fn timer_event_kind() -> EventKind

#
timer_plan

fn timer_plan(name : String, start_after? : Int, interval? : Int, times? : Int, priority? : Int) -> TimerPlan

#
trace_digest

fn trace_digest(entries : Array[TraceEntry]) -> UInt64

#
trace_entry

fn trace_entry(tick : Int, event_id : Int, kind : String, detail : String) -> TraceEntry

#
trace_filter_detail

fn trace_filter_detail(entries : Array[TraceEntry], detail : String) -> Array[TraceEntry]

#
trace_filter_kind

fn trace_filter_kind(entries : Array[TraceEntry], kind : String) -> Array[TraceEntry]

#
trace_filter_tick_range

fn trace_filter_tick_range(entries : Array[TraceEntry], min_tick : Int, max_tick : Int) -> Array[TraceEntry]

#
trace_query

fn trace_query(kind? : String, detail? : String, min_tick? : Int, max_tick? : Int) -> TraceQuery

#
trace_query_result

fn trace_query_result(entries : Array[TraceEntry]) -> TraceQueryResult

#
trace_stats

fn trace_stats(entries : Array[TraceEntry]) -> TraceStats

#
trace_to_text

fn trace_to_text(entries : Array[TraceEntry]) -> String

#
transition

fn transition(from : String, event : String, to : String, action? : String) -> Transition

#
validate_metrics

fn validate_metrics(metrics : Metrics) -> ValidationReport

#
validate_sim

fn validate_sim(sim : Sim) -> ValidationReport

#
validate_trace

fn validate_trace(entries : Array[TraceEntry]) -> ValidationReport

#
validation_issue

fn validation_issue(code : String, message : String, severity? : String) -> ValidationIssue

#
version

fn version() -> String

#
weighted_choice

fn weighted_choice(label : String, weight : Int) -> WeightedChoice