Turn one event into multiple metrics #554
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a little funky, but it seemed to hit the right spot of non-invasive, flexible, and no perf impact (I was worried but the benches say I'm ok). Basically, transforms now have the option to implement a
transform_into
method where they can push as many events as they want into an output vec. The weird part is that this "overrides" thetransform
function but you still have to implement it.Reasons I didn't do other things:
transform
required a bunch of changes and made most transforms more annoying to write, plus required allocating that vec no matter whatsend
is asynctransform
andtransform
into would have gotten rid of the weirdness, but that also seemed like too much work for the moment. I think it's more likely that we rework this before too long than someone gets confused about the two methods.Closes #379