zlhahaha/moonsim/core does not have a README file
pub(all) struct Backoff {
initial : Int
factor : Int
max_delay : Int
jitter : Int
current : Int
}pub(all) struct EventFailureCase {
seed : UInt64
rule : String
digest : UInt64
events : Array[EventRecord]
policy : EventMutationPolicy
source_events : Array[EventRecord]
}pub enum EventKind {
Message
Task
Timer
StateTransition
ExternalCall
}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
}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
}pub(all) struct EventReplayResult {
seed : UInt64
digest : UInt64
events : Array[EventRecord]
scheduled : Int
dropped : Int
duplicated : Int
failed : Int
}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) -> EventRecordpub(all) struct EventView {
id : Int
tick : Int
priority : Int
name : String
status : String
}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
}pub(all) struct Message {
id : Int
from : String
to : String
body : String
send_tick : Int
deliver_tick : Int
dropped : Bool
}fn MessageBus::send(self : MessageBus, sim : Sim, from : String, to : String, body : String, delay? : Int) -> Intpub(all) struct MetricDiff {
counters : Array[MetricDelta]
gauges : Array[MetricDelta]
sample_delta : Int
}pub(all) struct MetricSnapshot {
counters : Array[CounterSample]
gauges : Array[CounterSample]
samples : Array[CounterSample]
}pub(all) struct Metrics {
counters : Array[CounterSample]
gauges : Array[CounterSample]
samples : Array[CounterSample]
}pub(all) struct QueueStats {
pending : Int
cancelled : Int
earliest_tick : Int
latest_tick : Int
}pub(all) struct ReplayBaseline {
name : String
digest : UInt64
entries : Array[TraceEntry]
counters : Array[CounterSample]
gauges : Array[CounterSample]
}pub(all) struct ReplayComparison {
name : String
matched : Bool
trace : TraceComparison
counter_mismatches : Int
gauge_mismatches : Int
}pub(all) struct Rng {
state : UInt64
}pub(all) struct SampleDistribution {
name : String
count : Int
min : Int
max : Int
median : Int
p90 : Int
}pub(all) struct SampleSummary {
name : String
count : Int
min : Int
max : Int
sum : Int
}pub(all) struct Scenario {
name : String
seed : UInt64
max_steps : Int
expectations : Array[ScenarioExpectation]
}pub(all) struct ScenarioExpectation {
kind : String
name : String
expected : String
}pub(all) struct ScenarioFailure {
kind : String
name : String
expected : String
actual : String
}pub(all) struct ScenarioReport {
name : String
passed : Bool
steps : Int
final_tick : Int
digest : UInt64
failures : Array[ScenarioFailure]
}pub(all) struct ScheduledEvent {
id : Int
tick : Int
priority : Int
name : String
cancelled : Bool
repeat_every : Int
remaining_runs : Int
}fn ScheduledEvent::repeating(id : Int, tick : Int, name : String, every : Int, times : Int, priority? : Int) -> ScheduledEventpub(all) struct Sim {
now : Int
next_id : Int
events : Array[ScheduledEvent]
trace_entries : Array[TraceEntry]
rng : Rng
metrics : Metrics
}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]
}pub(all) struct StateMachine {
name : String
state : String
transitions : Array[Transition]
history : Array[TransitionResult]
}pub(all) struct TimelineBucket {
start_tick : Int
end_tick : Int
events : Int
executions : Int
metrics : Int
messages : Int
}pub(all) struct TimerPlan {
name : String
start_after : Int
interval : Int
times : Int
priority : Int
}pub(all) struct TraceComparison {
matched : Bool
checked : Int
left_digest : UInt64
right_digest : UInt64
mismatch : TraceMismatch?
}pub(all) struct TraceEntry {
tick : Int
event_id : Int
kind : String
detail : String
}pub(all) struct TraceExpectation {
passed : Bool
label : String
expected : String
actual : String
}pub(all) struct TraceMismatch {
index : Int
left : String
right : String
reason : String
}pub(all) struct TraceQuery {
kind : String
detail : String
min_tick : Int
max_tick : Int
}pub(all) struct TraceQueryResult {
entries : Array[TraceEntry]
first_tick : Int
last_tick : Int
kind_counts : Array[TraceKindCount]
}pub(all) struct TraceStats {
entries : Int
schedules : Int
executions : Int
cancellations : Int
rng_draws : Int
metrics : Int
messages : Int
}pub(all) struct Transition {
from : String
event : String
to : String
action : String
}pub(all) struct TransitionResult {
accepted : Bool
from : String
event : String
to : String
action : String
reason : String
}pub(all) struct ValidationIssue {
code : String
message : String
severity : String
}fn compare_forks(left_name : String, left : Sim, right_name : String, right : Sim) -> ForkComparisonfn event_failure_case(rule : String, source : EventStream, policy : EventMutationPolicy) -> EventFailureCasefn event_mutation_policy(seed? : UInt64, max_delay? : Int, delay_percent? : Int, drop_percent? : Int, duplicate_percent? : Int, reorder_same_tick? : Bool, failure_percent? : Int) -> EventMutationPolicyfn 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) -> EventRecordfn expect_trace_kind_count(entries : Array[TraceEntry], kind : String, expected : Int) -> TraceExpectationfn expect_trace_order(entries : Array[TraceEntry], before_detail : String, after_detail : String) -> TraceExpectationfn timer_plan(name : String, start_after? : Int, interval? : Int, times? : Int, priority? : Int) -> TimerPlanfn trace_filter_tick_range(entries : Array[TraceEntry], min_tick : Int, max_tick : Int) -> Array[TraceEntry]Deterministic simulation and model testing toolkit for MoonBit.