Module Bonsai_bench_scenario.Interaction

type 'action t

A 'action Interaction.t represents an interaction that occurs with a Bonsai computation whose action type is 'action.

It's useful for tests and benchmarks.

val update_input : 'a Input.t -> f:('a -> 'a) -> _ t

update_input updates the given Input.t using the supplied function.

val change_input : 'a Input.t -> 'a -> _ t

change_input sets the given Input.t to the supplied value.

val inject : 'action -> 'action t

inject calls the inject_action function for the component being benchmarked with the supplied action.

val advance_clock_by : Core.Time_ns.Span.t -> _ t

advance_clock_by advances the current clock by the supplied amount. Note that the clock is not reset between benchmark runs.

val recompute : _ t

recompute forces a stabilization of the incremental graph for the component being benchmarked, and triggers lifecycle events.

val reset_model : _ t

reset_model resets the benchmarked component's model back to the value it was at the beginning of the benchmark.

val profile : name:string -> _ t

profile indicates that the profile function below should print a snapshot of the time spent in each part of your computation since the previous snapshot.

By default, Bonsai_bench.profile will take a snapshot after startup, and another after running all interactions. Interaction.profile can be used to add an additional snapshot, in between your other interactions.

Note: profiling interactions are filtered out when not running Bonsai_bench.profile, so including them is free.

val many : 'action t list -> 'action t

many is used to create lists of interactions all at once. Interactions created this way will get flattened prior to benchmark runtime, so that there isn't performance cost to using the constructor.

val many_with_recomputes : 'action t list -> 'action t

many_with_recomputes is similar to many, but intersperses recomputes in the supplied list of actions.

module Finalized : sig ... end
val finalize : filter_profiles:bool -> 'a t -> 'a Finalized.t list