You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of defining inline functions that help run an action-test until a certain event, we can use generics.
Example:
// in rollup package// IsEventType is syntax-sugar to do a type check as a boolean functionfuncIsEventType[TEvent](evEvent) bool {
_, ok:=ev.(T)
returnok
}
// IsEventAny combines different event conditions into a single functionfuncIsEventAny(fns...func(evEvent) bool) func(evEvent) bool {
returnfunc(evEvent) bool {
for_, fn:=rangefns {
iffn(ev) {
returntrue
}
}
returnfalse
}
}
// in action test package, example:sequencer.ActL2EventsUntil(rollup.IsEventEny(rollup.IsEventType[derive.DeriverIdleEvent], rollup.IsEventType[engine.PendingSafeUpdateEvent]))
Generally the op-e2e tests, especially the action-test framework, can benefit from the new event system, and introducing some helper functions would improve future test writing.
Event metrics
We can add 2 counter metrics:
total emitted events
total processed events
And with the stringified event type (.String(), no need for reflection) as event label.
From these two we can then monitor a lot of the processing:
rate of events
backlogs (diff of emitted and processed)
All per event type, and the totals.
Event package
We can probably make this even more elegant, by putting all the event utils and types into its own event package:
helpers: event.Is, event.Any
main interface type: event.Event
relevant interfaces: event.Emitter, event.Deriver
core utils: event.Loop (the rollup.SynchronousEvents loop util)
future utils: event.System (the parallel processing system)
etc.
This way the type util/interface usage reads better.
The text was updated successfully, but these errors were encountered:
Event helper functions
See review-discussion in: #10947 (review)
Instead of defining inline functions that help run an action-test until a certain event, we can use generics.
Example:
Generally the op-e2e tests, especially the action-test framework, can benefit from the new event system, and introducing some helper functions would improve future test writing.
Event metrics
We can add 2 counter metrics:
And with the stringified event type (
.String()
, no need for reflection) asevent
label.From these two we can then monitor a lot of the processing:
All per event type, and the totals.
Event package
We can probably make this even more elegant, by putting all the event utils and types into its own
event
package:event.Is
,event.Any
event.Event
event.Emitter
,event.Deriver
event.Loop
(therollup.SynchronousEvents
loop util)event.System
(the parallel processing system)This way the type util/interface usage reads better.
The text was updated successfully, but these errors were encountered: